From dfd9ecf5c92b34898a72025e6264e70944355586 Mon Sep 17 00:00:00 2001 From: Yuxuan Shui Date: Thu, 18 Apr 2019 00:37:20 +0100 Subject: [PATCH] core: fix use-after-free in session_init Signed-off-by: Yuxuan Shui --- src/compton.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/compton.c b/src/compton.c index 8a419378..79125581 100644 --- a/src/compton.c +++ b/src/compton.c @@ -2067,13 +2067,13 @@ static session_t *session_init(int argc, char **argv, Display *dpy, children = NULL; nchildren = 0; } - free(reply); for (int i = 0; i < nchildren; i++) { auto w = add_win_above(ps, children[i], i ? children[i - 1] : XCB_NONE); fill_win(ps, w); } + free(reply); HASH_ITER2(ps->windows, w) { assert(!w->is_new);