From: Michal Privoznik Date: Tue, 14 May 2019 08:42:42 +0000 (+0200) Subject: storagepoolxml2argvtest: Avoid double free X-Git-Tag: v5.4.0-rc1~80 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=230243594eccce7b4e66e9047e5be9a52fee312c;p=thirdparty%2Flibvirt.git 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 Reviewed-by: Erik Skultety --- diff --git a/tests/storagepoolxml2argvtest.c b/tests/storagepoolxml2argvtest.c index b7e32064af..0c01931946 100644 --- a/tests/storagepoolxml2argvtest.c +++ b/tests/storagepoolxml2argvtest.c @@ -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);