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:
parent
1900936fe6
commit
c3ce83678c
@ -277,15 +277,13 @@ qemuTPMEmulatorGetPid(const char *swtpmStateDir,
|
|||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
g_autofree char *swtpm = virTPMGetSwtpm();
|
g_autofree char *swtpm = virTPMGetSwtpm();
|
||||||
char *pidfile = qemuTPMEmulatorCreatePidFilename(swtpmStateDir,
|
g_autofree char *pidfile = qemuTPMEmulatorCreatePidFilename(swtpmStateDir,
|
||||||
shortName);
|
shortName);
|
||||||
if (!pidfile)
|
if (!pidfile)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
ret = virPidFileReadPathIfAlive(pidfile, pid, swtpm);
|
ret = virPidFileReadPathIfAlive(pidfile, pid, swtpm);
|
||||||
|
|
||||||
VIR_FREE(pidfile);
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user