]> git.ipfire.org Git - thirdparty/libvirt.git/commit
util: reset the counters to zero
authorMarc Hartmayer <mhartmay@linux.vnet.ibm.com>
Thu, 9 Feb 2017 14:13:37 +0000 (15:13 +0100)
committerLaine Stump <laine@laine.org>
Thu, 9 Feb 2017 19:20:42 +0000 (14:20 -0500)
commitc26fe44be59abdc44169a97ec973f13e0e747452
treee36031b8fac98b1aab299871a004ee91445b0983
parent28dd54a5b971764c9a3a89b66acde053efaec2f7
util: reset the counters to zero

After freeing the data structures we have to reset the counters to
zero. This fixes a segmentation fault when virNetDevIPInfoClear is
called twice (e.g. this is possible in virDomainNetDefParseXML() if
virDomainNetIPInfoParseXML(...) fails with ret < 0 (this leads to the
first call of 'virNetDevIPInfoClear(&def->guestIP)') and the resulting
call of virDomainNetDefFree(def) in the error path of
virDomainNetDefParseXML() (this leads to the second call of
virNetDevIPInfoClear(&def->guestIP), and finally to the segmentation
fault).

Signed-off-by: Marc Hartmayer <mhartmay@linux.vnet.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.vnet.ibm.com>
Reviewed-by: Bjoern Walk <bwalk@linux.vnet.ibm.com>
src/util/virnetdevip.c