]> code.delx.au - spectrwm/blobdiff - spectrwm.c
plug memleak in find_window
[spectrwm] / spectrwm.c
index c674051ba5193ab1b88e3a161039e1256b3c50aa..1751412f18b4a70c6c3d34dca787b01f9800bcd9 100644 (file)
@@ -2299,8 +2299,10 @@ find_window(xcb_window_t id)
                return (NULL);
 
        /* if we were looking for the parent return that window instead */
-       if (r->parent == 0 || r->root == r->parent)
+       if (r->parent == 0 || r->root == r->parent) {
+               free(r);
                return (NULL);
+       }
 
        /* look for parent */
        for (i = 0; i < num_screens; i++)