mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
qemu: Fix the memory leak
Found by John Ferlan (coverity script)
This commit is contained in:
@@ -1042,6 +1042,7 @@ qemuAddSharedDisk(virQEMUDriverPtr driver,
|
||||
if ((VIR_ALLOC(entry) < 0) ||
|
||||
(VIR_ALLOC_N(entry->domains, 1) < 0) ||
|
||||
!(entry->domains[0] = strdup(name))) {
|
||||
qemuSharedDiskEntryFree(entry, NULL);
|
||||
virReportOOMError();
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user