From: Markus Groß Date: Thu, 26 May 2011 15:16:31 +0000 (+0800) Subject: Fix libxl vm def handling on domU cleanup X-Git-Tag: CVE-2011-2178~74 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=685753a3605f0c4d7e5aab8c73bac71fcddde963;p=thirdparty%2Flibvirt.git Fix libxl vm def handling on domU cleanup * src/libxl/libxl_driver.c: in libxlVmCleanup, free up the newDef definition if present overwise it would be leaked. --- diff --git a/src/libxl/libxl_driver.c b/src/libxl/libxl_driver.c index b2cc0e8ace..ccb17b2f7e 100644 --- a/src/libxl/libxl_driver.c +++ b/src/libxl/libxl_driver.c @@ -276,6 +276,13 @@ libxlVmCleanup(libxlDriverPrivatePtr driver, VIR_DEBUG("Failed to remove domain XML for %s", vm->def->name); VIR_FREE(file); } + + if (vm->newDef) { + virDomainDefFree(vm->def); + vm->def = vm->newDef; + vm->def->id = -1; + vm->newDef = NULL; + } } /*