From: Daniel P. Berrange Date: Tue, 24 Sep 2013 15:25:16 +0000 (+0100) Subject: Fix failure to honour OOM status in qemuParseNBDString X-Git-Tag: v1.1.3-rc1~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a72d25f40f619c3174d23a06384d6551e16cf388;p=thirdparty%2Flibvirt.git Fix failure to honour OOM status in qemuParseNBDString In qemuParseNBDString, if the virURIParse fails, the error is not reported to the caller. Instead execution falls through to the non-URI codepath causing memory leaks later on. Signed-off-by: Daniel P. Berrange --- diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index 00ca93e8c7..50b4d70aa8 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -3556,9 +3556,9 @@ qemuParseNBDString(virDomainDiskDefPtr disk) virURIPtr uri = NULL; if (strstr(disk->src, "://")) { - uri = virURIParse(disk->src); - if (uri) - return qemuParseDriveURIString(disk, uri, "nbd"); + if (!(uri = virURIParse(disk->src))) + return -1; + return qemuParseDriveURIString(disk, uri, "nbd"); } if (VIR_ALLOC(h) < 0)