1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: tpm: Use g_autofree in qemuTPMEmulatorGetPid

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2019-11-13 13:15:50 +01:00
parent 1900936fe6
commit c3ce83678c

View File

@ -277,15 +277,13 @@ qemuTPMEmulatorGetPid(const char *swtpmStateDir,
{
int ret;
g_autofree char *swtpm = virTPMGetSwtpm();
char *pidfile = qemuTPMEmulatorCreatePidFilename(swtpmStateDir,
shortName);
g_autofree char *pidfile = qemuTPMEmulatorCreatePidFilename(swtpmStateDir,
shortName);
if (!pidfile)
return -ENOMEM;
ret = virPidFileReadPathIfAlive(pidfile, pid, swtpm);
VIR_FREE(pidfile);
return ret;
}