mirror of https://gitee.com/openkylin/libvirt.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 <mprivozn@redhat.com>
This commit is contained in:
parent
065054daa7
commit
a3b168d01a
|
@ -181,7 +181,7 @@ char *
|
||||||
virSystemdGetMachineNameByPID(pid_t pid)
|
virSystemdGetMachineNameByPID(pid_t pid)
|
||||||
{
|
{
|
||||||
DBusConnection *conn;
|
DBusConnection *conn;
|
||||||
DBusMessage *reply;
|
DBusMessage *reply = NULL;
|
||||||
char *name = NULL, *object = NULL;
|
char *name = NULL, *object = NULL;
|
||||||
|
|
||||||
if (virDBusIsServiceEnabled("org.freedesktop.machine1") < 0)
|
if (virDBusIsServiceEnabled("org.freedesktop.machine1") < 0)
|
||||||
|
|
Loading…
Reference in New Issue