From a3b168d01a6254a5972d4eda87d7cbc3d9cdb3ef Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Fri, 5 Feb 2016 17:17:45 +0100 Subject: [PATCH] virSystemdGetMachineNameByPID: Initialize @reply I've noticed that variable @reply is not initialized and if something at the beginning of the function fails, e.g. virDBusGetSystemBus(), the control jump straight to cleanup label where dbus_message_unref() is then called over this uninitialized variable. Signed-off-by: Michal Privoznik --- src/util/virsystemd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/virsystemd.c b/src/util/virsystemd.c index 37007aa915..6677798099 100644 --- a/src/util/virsystemd.c +++ b/src/util/virsystemd.c @@ -181,7 +181,7 @@ char * virSystemdGetMachineNameByPID(pid_t pid) { DBusConnection *conn; - DBusMessage *reply; + DBusMessage *reply = NULL; char *name = NULL, *object = NULL; if (virDBusIsServiceEnabled("org.freedesktop.machine1") < 0) -- 2.39.5