Fix memory leak: free marks when destroying containers (#2578)

This commit is contained in:
Michael Stapelberg 2016-11-21 02:41:15 -08:00 committed by GitHub
parent 90d68d7ea0
commit 2f9bb7dd5a
1 changed files with 6 additions and 0 deletions

View File

@ -329,6 +329,12 @@ bool tree_close_internal(Con *con, kill_window_t kill_window, bool dont_kill_par
match_free(match);
free(match);
}
while (!TAILQ_EMPTY(&(con->marks_head))) {
mark_t *mark = TAILQ_FIRST(&(con->marks_head));
TAILQ_REMOVE(&(con->marks_head), mark, marks);
FREE(mark->name);
FREE(mark);
}
free(con);
/* in the case of floating windows, we already focused another container