[PATCH] util: Don't leak @replay in virSystemdGetMachineNameByPID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



@reply is a DBusMessage object returned by virDBusCallMethod in
get machine object call path, dereference it before calling
virDBusCallMethod again to get machine name.
---
 src/util/virsystemd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c
index 83737a2..5d9746f 100644
--- a/src/util/virsystemd.c
+++ b/src/util/virsystemd.c
@@ -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);
 
-- 
2.8.3


--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]
  Powered by Linux