]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
qemu: Fix segfault in qemuMonitorTextGetBlockInfo
authorHendrik Schwartke <hendrik@os-t.de>
Mon, 30 Jan 2012 12:36:46 +0000 (13:36 +0100)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 30 Jan 2012 12:48:34 +0000 (13:48 +0100)
If some error occurs then the cleanup code calls VIR_FREE(info)
without ensuring that info is initialized.

AUTHORS
src/qemu/qemu_monitor_text.c

diff --git a/AUTHORS b/AUTHORS
index 166b76fc6b90e9d8c16bfa1907a35a0d91b52df3..d995ac21f5eddeac7847112367091524f6db029f 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -219,6 +219,7 @@ Patches have also been contributed by:
   Laszlo Ersek         <lersek@redhat.com>
   Zeeshan Ali (Khattak) <zeeshanak@gnome.org>
   Marcelo Cerri        <mhcerri@linux.vnet.ibm.com>
+  Hendrik Schwartke    <hendrik@os-t.de>
 
   [....send patches to get your name here....]
 
index a33d192c2db9cea8a06bfdeb66438555b98cabb0..edeb435612164750d88059c7e98d296346069cc4 100644 (file)
@@ -774,7 +774,7 @@ int qemuMonitorTextGetMemoryStats(qemuMonitorPtr mon,
 int qemuMonitorTextGetBlockInfo(qemuMonitorPtr mon,
                                 virHashTablePtr table)
 {
-    struct qemuDomainDiskInfo *info;
+    struct qemuDomainDiskInfo *info = NULL;
     char *reply = NULL;
     int ret = -1;
     char *dummy;