提交 15613359 编写于 作者: J Jim Meyering

tests: teach syntax-check that virDomainDefFree has free-like semantics

* cfg.mk (useless_free_options): Add virDomainDefFree to the list
of free-like functions.
* src/test/test_driver.c (testDomainCreateXML): Remove useless-if-
before-virDomainDefFree.
* src/conf/domain_conf.c (virDomainAssignDef): Likewise
上级 e36be6e7
......@@ -64,6 +64,7 @@ useless_free_options = \
--name=VIR_FREE \
--name=xmlFree \
--name=xmlXPathFreeContext \
--name=virDomainDefFree \
--name=xmlXPathFreeObject
# Avoid uses of write(2). Either switch to streams (fwrite), or use
......
......@@ -759,8 +759,7 @@ virDomainObjPtr virDomainAssignDef(virCapsPtr caps,
virDomainDefFree(domain->def);
domain->def = def;
} else {
if (domain->newDef)
virDomainDefFree(domain->newDef);
virDomainDefFree(domain->newDef);
domain->newDef = def;
}
......
......@@ -1328,8 +1328,7 @@ cleanup:
virDomainObjUnlock(dom);
if (event)
testDomainEventQueue(privconn, event);
if (def)
virDomainDefFree(def);
virDomainDefFree(def);
testDriverUnlock(privconn);
return ret;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册