From 2f9bb7dd5a296f002219fbbdcb6169410d529814 Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Mon, 21 Nov 2016 02:41:15 -0800 Subject: [PATCH] Fix memory leak: free marks when destroying containers (#2578) --- src/tree.c | 6 ++++++ 1 file changed, 6 insertions(+) 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 -- 2.39.5