mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 06:50:22 +03:00
util: Don't leak @reply in virSystemdGetMachineNameByPID
@reply is a DBusMessage object returned by virDBusCallMethod in get machine object call path, dereference it before calling virDBusCallMethod again to get machine name. Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
parent
f7c7f450f3
commit
c4a4c01e6e
@ -247,6 +247,9 @@ virSystemdGetMachineNameByPID(pid_t pid)
|
||||
if (virDBusMessageRead(reply, "o", &object) < 0)
|
||||
goto cleanup;
|
||||
|
||||
virDBusMessageUnref(reply);
|
||||
reply = NULL;
|
||||
|
||||
VIR_DEBUG("Domain with pid %lld has object path '%s'",
|
||||
(long long) pid, object);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user