From: Michal Privoznik Date: Fri, 5 Feb 2016 16:17:45 +0000 (+0100) Subject: virSystemdGetMachineNameByPID: Initialize @reply X-Git-Tag: v1.3.2-rc1~224 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a3b168d01a6254a5972d4eda87d7cbc3d9cdb3ef;p=thirdparty%2Flibvirt.git 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 --- 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)