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 <ian.jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
This commit is contained in:
Ian Jackson committed 2012-05-17 14:45:41 +01:00
1 parent 79d00fc950
commit a836d6543e
1 file changed
+2 -2
+2 -2
View 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);
}
/*
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.