]> git.ipfire.org Git - thirdparty/libvirt.git/commit
network: Set to NULL after virNetworkDefFree()
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Oct 2012 14:28:35 +0000 (16:28 +0200)
committerCole Robinson <crobinso@redhat.com>
Sat, 27 Oct 2012 19:03:02 +0000 (15:03 -0400)
commitec08a738e8644e6edef846747019a9ccbba4f597
treec0e68fc7f84ab3468d18531c1de5ff03e9d15b05
parent4c2a38d1edbee7cdceed665e8d42bfa23728d960
network: Set to NULL after virNetworkDefFree()

which frees all allocated memory but doesn't set the passed pointer to
NULL.  Therefore, we must do it ourselves. This is causing actual
libvirtd crash: Basically, when doing 'virsh net-edit' the newDef should
be dropped.  And the memory is freed, indeed. However, the pointer is
not set to NULL but kept instead. And the next duo of calls 'virsh
net-start' and 'virsh net-destroy' starts the disaster. The latter one
does the same as 'virsh destroy'; it sees that newDef is nonNULL so it
replaces def with newDef (which has been freed already as said a few
lines above). Therefore any subsequent call accessing def will hit the ground.
(cherry picked from commit b7e9202401ebaa039b8f05acdefda8c24081537a)
src/conf/network_conf.c