]> git.sur5r.net Git - i3/i3/commitdiff
Fix memory leak: free marks when destroying containers (#2578)
authorMichael Stapelberg <stapelberg@users.noreply.github.com>
Mon, 21 Nov 2016 10:41:15 +0000 (02:41 -0800)
committerGitHub <noreply@github.com>
Mon, 21 Nov 2016 10:41:15 +0000 (02:41 -0800)
src/tree.c

index 6e128363913319decb436054d39526ec2b104b75..d2fe4e07972327b1da827acddad5a87c43de346a 100644 (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