mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-08-25 13:50:09 +03: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