1
0
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:
Osier Yang 2013-02-21 10:32:15 +08:00
parent 903f43ce6d
commit 5c9034bf05

View File

@ -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;
}