mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-21 20:15: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)) {
|
||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
||||
_("%s does not support passing a passphrase using a file "
|
||||
"descriptor"), virTPMGetSwtpmSetup());
|
||||
"descriptor"), swtpm_setup);
|
||||
goto cleanup;
|
||||
}
|
||||
if ((pwdfile_fd = qemuTPMSetupEncryption(secretuuid, cmd)) < 0)
|
||||
@ -652,7 +652,7 @@ qemuTPMEmulatorBuildCommand(virDomainTPMDefPtr tpm,
|
||||
if (!virTPMSwtpmCapsGet(VIR_TPM_SWTPM_FEATURE_CMDARG_PWD_FD)) {
|
||||
virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
|
||||
_("%s does not support passing passphrase via file descriptor"),
|
||||
virTPMGetSwtpm());
|
||||
swtpm);
|
||||
goto error;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user