]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Fix failure to honour OOM status in qemuParseNBDString
authorDaniel P. Berrange <berrange@redhat.com>
Tue, 24 Sep 2013 15:25:16 +0000 (16:25 +0100)
committerDaniel P. Berrange <berrange@redhat.com>
Wed, 25 Sep 2013 14:49:13 +0000 (15:49 +0100)
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 <berrange@redhat.com>
src/qemu/qemu_command.c

index 00ca93e8c77efc05691a1b756bec2be5ab8f751f..50b4d70aa83136fbb9b7e738898e6c9673075307 100644 (file)
@@ -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)