mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-07 17:28:15 +00:00
qemu: Fix the memory leak
Found by John Ferlan (coverity script)
This commit is contained in:
parent
903f43ce6d
commit
5c9034bf05
@ -1042,6 +1042,7 @@ qemuAddSharedDisk(virQEMUDriverPtr driver,
|
|||||||
if ((VIR_ALLOC(entry) < 0) ||
|
if ((VIR_ALLOC(entry) < 0) ||
|
||||||
(VIR_ALLOC_N(entry->domains, 1) < 0) ||
|
(VIR_ALLOC_N(entry->domains, 1) < 0) ||
|
||||||
!(entry->domains[0] = strdup(name))) {
|
!(entry->domains[0] = strdup(name))) {
|
||||||
|
qemuSharedDiskEntryFree(entry, NULL);
|
||||||
virReportOOMError();
|
virReportOOMError();
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user