]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
libxl: fix segfault when domain create fail
authorBamvor Jian Zhang <bjzhang@suse.com>
Fri, 20 Dec 2013 07:14:42 +0000 (15:14 +0800)
committerJim Fehlig <jfehlig@suse.com>
Fri, 20 Dec 2013 18:49:24 +0000 (11:49 -0700)
there is a segfault in libxl logging in libxl_ctx_free when domain
create fail. because the log output handler vmessage is freed by
xtl_logger_destroy before libxl_ctx_free in virDomainObjListRemove.
move xtl_logger_destroy after libxl_ctx_free could fix this bug.

Signed-off-by: Bamvor Jian Zhang <bjzhang@suse.com>
src/libxl/libxl_domain.c

index 68009db2cdf3ed913e3b9f4a73fbd41588918b48..e72c483491439e698617e9d87640ba668d4ba539 100644 (file)
@@ -354,12 +354,11 @@ libxlDomainObjPrivateDispose(void *obj)
         libxl_evdisable_domain_death(priv->ctx, priv->deathW);
 
     virChrdevFree(priv->devs);
-
-    xtl_logger_destroy(priv->logger);
+    libxl_ctx_free(priv->ctx);
     if (priv->logger_file)
         VIR_FORCE_FCLOSE(priv->logger_file);
 
-    libxl_ctx_free(priv->ctx);
+    xtl_logger_destroy(priv->logger);
 }
 
 static void