core: fix use-after-free in session_init

Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
This commit is contained in:
Yuxuan Shui 2019-04-18 00:37:20 +01:00
parent a96cdc7e15
commit dfd9ecf5c9
No known key found for this signature in database
GPG Key ID: 37C999F617EA1A47
1 changed files with 1 additions and 1 deletions

View File

@ -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);