]> git.ipfire.org Git - thirdparty/libvirt.git/commit
libxl: fix resource leaks in libxlDomainStart error paths
authorChunyan Liu <cyliu@suse.com>
Mon, 28 Mar 2016 19:55:42 +0000 (13:55 -0600)
committerJim Fehlig <jfehlig@suse.com>
Tue, 29 Mar 2016 20:16:31 +0000 (14:16 -0600)
commit45fc2c14363f3c9c96cd4f42f30d0ca7ee99adcb
treeb173fdab81f8cbf20cbd4018e939f191a026fbfb
parenta75e35a0834eae327a15882390eea4ab6aeeea1f
libxl: fix resource leaks in libxlDomainStart error paths

libxlDomainStart allocates and reserves resources that were not
being released in error paths. libxlDomainCleanup already handles
the job of releasing resources, and libxlDomainStart should call
it when encountering a failure.

Change the error handling logic to call libxlDomainCleanup on
failure. This includes acquiring the lease sooner and allowing
it to be released in libxlDomainCleanup on failure, similar to
the way other resources are reclaimed. With the lease now
released in libxlDomainCleanup, the release_dom label can be
renamed to cleanup_dom to better reflect its changed semantics.

Signed-off-by: Jim Fehlig <jfehlig@suse.com>
src/libxl/libxl_domain.c