commands.c: fix memory leak

This commit is contained in:
Michael Stapelberg 2016-01-09 13:39:00 +01:00
parent ada71471c1
commit 79594398e2

View File

@ -62,6 +62,11 @@
HANDLE_INVALID_MATCH; \ HANDLE_INVALID_MATCH; \
\ \
if (match_is_empty(current_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)); \ owindow *ow = smalloc(sizeof(owindow)); \
ow->con = focused; \ ow->con = focused; \
TAILQ_INIT(&owindows); \ TAILQ_INIT(&owindows); \