From: Michael Stapelberg Date: Mon, 21 Nov 2016 10:41:15 +0000 (-0800) Subject: Fix memory leak: free marks when destroying containers (#2578) X-Git-Tag: 4.14~91 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2f9bb7dd5a296f002219fbbdcb6169410d529814;p=i3%2Fi3 Fix memory leak: free marks when destroying containers (#2578) --- diff --git a/src/tree.c b/src/tree.c index 6e128363..d2fe4e07 100644 --- a/src/tree.c +++ b/src/tree.c @@ -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