]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: eliminate potential memory leak on parse failure
authorLaine Stump <laine@laine.org>
Thu, 11 Aug 2011 03:28:05 +0000 (23:28 -0400)
committerLaine Stump <laine@laine.org>
Thu, 11 Aug 2011 18:39:22 +0000 (14:39 -0400)
commit4a6ffae3b64287e63cab6f1ab40d162dcd898333
treeacb426302186ccabda1bfcd25f6b1ddff693f01b
parent762101c7affbd32af18eccc07249c2684cbb84a2
network: eliminate potential memory leak on parse failure

While the first encountered dns host record is being parsed, it's
possible for virNetworkDef::hosts to point to memory that has been
allocated, but virNetworkDef::nhosts to still be 0. If there is a
failure during that time, virNetworkDef::hosts will be leaked.

Although this isn't currently the case for virNetworkDef::txtrecords,
it could become that way through future re-factoring, and it hurts
nothing to restructure the freeing of txtrecord data to match that of
hosts data.
src/conf/network_conf.c