From 79594398e2e042a466c3c0b20fb31d544b6c5d2b Mon Sep 17 00:00:00 2001 From: Michael Stapelberg Date: Sat, 9 Jan 2016 13:39:00 +0100 Subject: [PATCH] commands.c: fix memory leak --- src/commands.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/commands.c b/src/commands.c index 0c6ff127..515b5776 100644 --- a/src/commands.c +++ b/src/commands.c @@ -62,6 +62,11 @@ HANDLE_INVALID_MATCH; \ \ if (match_is_empty(current_match)) { \ + while (!TAILQ_EMPTY(&owindows)) { \ + owindow *ow = TAILQ_FIRST(&owindows); \ + TAILQ_REMOVE(&owindows, ow, owindows); \ + free(ow); \ + } \ owindow *ow = smalloc(sizeof(owindow)); \ ow->con = focused; \ TAILQ_INIT(&owindows); \ -- 2.39.5