From: Michael Stapelberg Date: Sat, 9 Jan 2016 12:39:00 +0000 (+0100) Subject: commands.c: fix memory leak X-Git-Tag: 4.12~51 X-Git-Url: https://git.sur5r.net/?p=i3%2Fi3;a=commitdiff_plain;h=79594398e2e042a466c3c0b20fb31d544b6c5d2b commands.c: fix memory leak --- 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); \