mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
e36be6e7c7
commit
156133597d
1
cfg.mk
1
cfg.mk
@ -64,6 +64,7 @@ useless_free_options = \
|
|||||||
--name=VIR_FREE \
|
--name=VIR_FREE \
|
||||||
--name=xmlFree \
|
--name=xmlFree \
|
||||||
--name=xmlXPathFreeContext \
|
--name=xmlXPathFreeContext \
|
||||||
|
--name=virDomainDefFree \
|
||||||
--name=xmlXPathFreeObject
|
--name=xmlXPathFreeObject
|
||||||
|
|
||||||
# Avoid uses of write(2). Either switch to streams (fwrite), or use
|
# Avoid uses of write(2). Either switch to streams (fwrite), or use
|
||||||
|
@ -759,7 +759,6 @@ virDomainObjPtr virDomainAssignDef(virCapsPtr caps,
|
|||||||
virDomainDefFree(domain->def);
|
virDomainDefFree(domain->def);
|
||||||
domain->def = def;
|
domain->def = def;
|
||||||
} else {
|
} else {
|
||||||
if (domain->newDef)
|
|
||||||
virDomainDefFree(domain->newDef);
|
virDomainDefFree(domain->newDef);
|
||||||
domain->newDef = def;
|
domain->newDef = def;
|
||||||
}
|
}
|
||||||
|
@ -1328,7 +1328,6 @@ cleanup:
|
|||||||
virDomainObjUnlock(dom);
|
virDomainObjUnlock(dom);
|
||||||
if (event)
|
if (event)
|
||||||
testDomainEventQueue(privconn, event);
|
testDomainEventQueue(privconn, event);
|
||||||
if (def)
|
|
||||||
virDomainDefFree(def);
|
virDomainDefFree(def);
|
||||||
testDriverUnlock(privconn);
|
testDriverUnlock(privconn);
|
||||||
return ret;
|
return ret;
|
||||||
|
Loading…
Reference in New Issue
Block a user