]> git.ipfire.org Git - thirdparty/libvirt.git/commit
qemu: eliminate memory leaks when converting NetDefs to type='ethernet'
authorLaine Stump <laine@laine.org>
Tue, 21 Jun 2016 18:29:17 +0000 (14:29 -0400)
committerLaine Stump <laine@laine.org>
Sun, 26 Jun 2016 23:33:08 +0000 (19:33 -0400)
commita71fd239bd1dad7ac7d656331c386e3fe1ad535c
tree8ea73a3d0563009662ae88d612a207f09fe5a461
parent910450928976ec1dc0f1c4047789356f8acc6a4f
qemu: eliminate memory leaks when converting NetDefs to type='ethernet'

in qemuConnectDomainXMLToNative. This function was only accounting for
about 1/10 of all the allocated items in the NetDef prior to memseting
it to all 0's. On top of that, it was going to great pains to learn
the name of the bridge device, but then never doing anything useful
with it (just putting it into data.ethernet.dev, which is *never* used
when building a qemu commandline). (I think this again all started off
as code with good intentions, but it was never completed, and instead
was just Frankensteinically cargo-culted into the odd mish mash we
have today).

The resulting code is much simpler, produces exactly the same output,
and doesn't leak memory.
src/qemu/qemu_driver.c