]> 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)
committerMichal Privoznik <mprivozn@redhat.com>
Thu, 18 Oct 2012 15:02:48 +0000 (17:02 +0200)
commitb7e9202401ebaa039b8f05acdefda8c24081537a
tree363a716b12eef0318ea8c6afabe701384185c9e4
parent47a7b93584af33916841ea98ab90fd47aca5991a
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.
src/conf/network_conf.c