1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2025-03-07 17:28:15 +00:00

qemu: Avoid NULL dereference in qemuSharedDiskEntryFree

At least one caller may call qemuSharedDiskEntryFree with NULL as the
first argument. Let's make the function similar to other *Free functions
and do nothing in such case.
This commit is contained in:
Jiri Denemark 2013-03-12 09:10:41 +01:00
parent 11677e081b
commit 57bb725aca

View File

@ -1045,6 +1045,9 @@ qemuSharedDiskEntryFree(void *payload, const void *name ATTRIBUTE_UNUSED)
qemuSharedDiskEntryPtr entry = payload;
size_t i;
if (!entry)
return;
for (i = 0; i < entry->ref; i++) {
VIR_FREE(entry->domains[i]);
}