]> xenbits.xensource.com Git - libvirt.git/commitdiff
storagepoolxml2argvtest: Avoid double free
authorMichal Privoznik <mprivozn@redhat.com>
Tue, 14 May 2019 08:42:42 +0000 (10:42 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Tue, 14 May 2019 13:58:37 +0000 (15:58 +0200)
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>
tests/storagepoolxml2argvtest.c

index b7e32064af3ed37ef7492121f266a98acc72f190..0c01931946407798e2bb4fca52dd3222b3ed1a95 100644 (file)
@@ -39,7 +39,6 @@ testCompareXMLToArgvFiles(bool shouldFail,
     case VIR_STORAGE_POOL_NETFS:
         if (!(pool = virStoragePoolObjNew())) {
             VIR_TEST_DEBUG("pool type '%s' alloc pool obj fails\n", defTypeStr);
-            virStoragePoolDefFree(def);
             goto cleanup;
         }
         virStoragePoolObjSetDef(pool, def);