提交 23024359 编写于 作者: M Michal Privoznik

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: NMichal Privoznik <mprivozn@redhat.com>
Reviewed-by: NErik Skultety <eskultet@redhat.com>
上级 cb0c3a70
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册