From a836d6543e0b417e147f01950e4fccfdc87fc449 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Thu, 17 May 2012 14:45:41 +0100 Subject: [PATCH] libxl: Do not use-after-free on ao progress reporting 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 Acked-by: Ian Campbell Committed-by: Ian Campbell --- tools/libxl/libxl_event.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/libxl/libxl_event.c b/tools/libxl/libxl_event.c index 350e846aa4..7fbd5c3702 100644 --- a/tools/libxl/libxl_event.c +++ b/tools/libxl/libxl_event.c @@ -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); } /* -- 2.30.2