qemu: Fix segfault in qemuMonitorTextGetBlockInfo

If some error occurs then the cleanup code calls VIR_FREE(info)
without ensuring that info is initialized.
This commit is contained in:
Hendrik Schwartke 2012-01-30 13:36:46 +01:00 committed by Michal Privoznik
parent efb0839c1d
commit 484a0bab39
2 changed files with 2 additions and 1 deletions

View File

@ -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....]

View 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;