mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-15 09:53:44 -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=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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user