]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: fix segfault in libxlReconnectDomain
authorCédric Bosdonnat <cbosdonnat@suse.com>
Wed, 27 Jul 2016 12:46:41 +0000 (14:46 +0200)
committerCédric Bosdonnat <cbosdonnat@suse.com>
Tue, 2 Aug 2016 12:20:31 +0000 (14:20 +0200)
commita9aafc0aa0515ecb35f586ef4e80b797b75e2812
tree4fcb12d29d1a19cad18096ea14232558b3223460
parentdb38eb406811a0dafa13a0a12315d9464c9d68c6
libxl: fix segfault in libxlReconnectDomain

In case of error, libxlReconnectDomain may call
virDomainObjListRemoveLocked. However it has no local reference on
the domain object, leading to segfault. Get a reference to the domain
object at the start of the function and release it at the end to avoid
problems.

This commit also factorizes code between the error and normal ends.
src/libxl/libxl_driver.c