]> xenbits.xensource.com Git - xen.git/commitdiff
libxl: Do not use-after-free on ao progress reporting
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 17 May 2012 13:45:41 +0000 (14:45 +0100)
committerIan Jackson <ian.jackson@eu.citrix.com>
Thu, 17 May 2012 13:45:41 +0000 (14:45 +0100)
We need to call libxl__free_all after egc_run_callbacks since some of
the callbacks might be ao progress reports allocated from the egc's
gc.

Fixes a segfault in egc_run_callbacks.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
tools/libxl/libxl_event.c

index 350e846aa45f8f830958012c2284d3abeb66e387..7fbd5c3702642800b8b1348f3863322d2dd6d657 100644 (file)
@@ -988,9 +988,9 @@ static void egc_run_callbacks(libxl__egc *egc)
 void libxl__egc_cleanup(libxl__egc *egc)
 {
     EGC_GC;
-    libxl__free_all(gc);
-
     egc_run_callbacks(egc);
+
+    libxl__free_all(gc);
 }
 
 /*