]> xenbits.xensource.com Git - libvirt.git/commit
qemu_domain: Drop needless free from qemuDomainObjPrivateXMLParse()
authorMichal Privoznik <mprivozn@redhat.com>
Wed, 11 May 2022 14:37:50 +0000 (16:37 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 12 May 2022 06:50:54 +0000 (08:50 +0200)
commit5b0bba799b1804d2c9a38458a55c09d9fb08a676
tree0c532c3d861f64a1002dfdc2bcdfa7f79a1dcb20
parent21aec91790ae14d24512856b20cff49764ede637
qemu_domain: Drop needless free from qemuDomainObjPrivateXMLParse()

The qemuDomainObjPrivateXMLParse() is responsible for parsing
given XML into qemuDomainObjPrivate struct. As it does so, memory
might be allocated for some members. If an error occurs during
parsing the control jumps onto 'error' label where only some of
previously allocated memory is freed. The reason there's no
memory leak is simple: the only caller (virDomainObjParseXML())
unrefs freshly created virDomainObj which in turn causes
qemuDomainObjPrivateFree() to be called. Therefore, these
partial, selective frees are needless and should be just dropped.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/qemu/qemu_domain.c