mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 14:15:28 +00:00
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 <berrange@redhat.com>
This commit is contained in:
parent
d7e9f9f7e8
commit
a72d25f40f
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user