[libvirt] [PATCH] util: Don't leak @replay 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. --- 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

On 05/20/2017 03:31 AM, Wang King wrote:
s/replay/reply/ in $SUBJ
@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(+)
ACKed and pushed. Michal
participants (2)
-
Michal Privoznik
-
Wang King