mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-01 17:35:17 +00:00
tpm: Fix memory leak and use existing variable instead
Use the existing variables rather then calling virTPMSwtpmXYZ(). Signed-off-by: Stefan Berger <stefanb@linux.ibm.com> Reviewed-by: John Ferlan <jferlan@redhat.com> Message-Id: <20190726205633.2041912-2-stefanb@linux.vnet.ibm.com>
This commit is contained in:
parent
e1ff8a95c6
commit
b8358f94e0
@ -512,7 +512,7 @@ qemuTPMEmulatorRunSetup(const char *storagepath,
|
|||||||
VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PWDFILE_FD)) {
|
VIR_TPM_SWTPM_SETUP_FEATURE_CMDARG_PWDFILE_FD)) {
|
||||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
||||||
_("%s does not support passing a passphrase using a file "
|
_("%s does not support passing a passphrase using a file "
|
||||||
"descriptor"), virTPMGetSwtpmSetup());
|
"descriptor"), swtpm_setup);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
if ((pwdfile_fd = qemuTPMSetupEncryption(secretuuid, cmd)) < 0)
|
if ((pwdfile_fd = qemuTPMSetupEncryption(secretuuid, cmd)) < 0)
|
||||||
@ -652,7 +652,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDefPtr tpm,
|
|||||||
if (!virTPMSwtpmCapsGet(VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD)) {
|
if (!virTPMSwtpmCapsGet(VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD)) {
|
||||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
||||||
_("%s does not support passing passphrase via file descriptor"),
|
_("%s does not support passing passphrase via file descriptor"),
|
||||||
virTPMGetSwtpm());
|
swtpm);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user