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 <mprivozn@redhat.com>
This commit is contained in:
Michal Privoznik 2016-02-05 17:17:45 +01:00
parent 065054daa7
commit a3b168d01a
1 changed files with 1 additions and 1 deletions

View File

@ -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)