mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-10-22 19:34:08 +03:00
storagepoolxml2argvtest: Avoid double free
A double free may occur in testCompareXMLToArgvFiles() when @def is freed right after virStoragePoolObjNew() failed and the second time at cleanup label. Signed-off-by: Michal Privoznik <mprivozn@redhat.com> Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
@@ -39,7 +39,6 @@ testCompareXMLToArgvFiles(bool shouldFail,
|
|||||||
case VIR_STORAGE_POOL_NETFS:
|
case VIR_STORAGE_POOL_NETFS:
|
||||||
if (!(pool = virStoragePoolObjNew())) {
|
if (!(pool = virStoragePoolObjNew())) {
|
||||||
VIR_TEST_DEBUG("pool type '%s' alloc pool obj fails\n", defTypeStr);
|
VIR_TEST_DEBUG("pool type '%s' alloc pool obj fails\n", defTypeStr);
|
||||||
virStoragePoolDefFree(def);
|
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
virStoragePoolObjSetDef(pool, def);
|
virStoragePoolObjSetDef(pool, def);
|
||||||
|
Reference in New Issue
Block a user