]> xenbits.xensource.com Git - libvirt.git/commitdiff
qemu: fix bad free
authorEric Blake <eblake@redhat.com>
Mon, 13 May 2013 22:48:55 +0000 (16:48 -0600)
committerEric Blake <eblake@redhat.com>
Mon, 13 May 2013 22:48:55 +0000 (16:48 -0600)
Commit bd56d0d8 could lead to freeing an uninitialized pointer:

qemu/qemu_monitor_json.c: In function 'qemuMonitorJSONGetCommandLineOptionParameters':
qemu/qemu_monitor_json.c:4284: warning: 'cmd' may be used uninitialized in this function

* src/qemu/qemu_monitor_json.c
(qemuMonitorJSONGetCommandLineOptionParameters): Initialize variable.

Signed-off-by: Eric Blake <eblake@redhat.com>
src/qemu/qemu_monitor_json.c

index 0c011d31b0d9ec9f2413b2d608ffabff02047bf5..d95198bc1f2a8557e1bd32fb7a6ae7d199a285f6 100644 (file)
@@ -4281,7 +4281,7 @@ qemuMonitorJSONGetCommandLineOptionParameters(qemuMonitorPtr mon,
                                               char ***params)
 {
     int ret;
-    virJSONValuePtr cmd;
+    virJSONValuePtr cmd = NULL;
     virJSONValuePtr reply = NULL;
     virJSONValuePtr data = NULL;
     virJSONValuePtr array = NULL;