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
This commit is contained in:
Jim Meyering 2010-03-25 21:53:29 +01:00
parent e36be6e7c7
commit 156133597d
3 changed files with 3 additions and 4 deletions

1
cfg.mk
View File

@ -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

View File

@ -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;
}

View File

@ -1328,8 +1328,7 @@ cleanup:
virDomainObjUnlock(dom);
if (event)
testDomainEventQueue(privconn, event);
if (def)
virDomainDefFree(def);
virDomainDefFree(def);
testDriverUnlock(privconn);
return ret;
}