]> git.sur5r.net Git - i3/i3/commitdiff
commands.c: fix memory leak
authorMichael Stapelberg <michael@stapelberg.de>
Sat, 9 Jan 2016 12:39:00 +0000 (13:39 +0100)
committerMichael Stapelberg <michael@stapelberg.de>
Sat, 9 Jan 2016 12:39:00 +0000 (13:39 +0100)
src/commands.c

index 0c6ff127df65bc0681be7866578e4114b0db7eeb..515b57760fdd8dff6694d43991cccc9f0f06170d 100644 (file)
         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);                      \