i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit 1668b2fc0fdbeb7427bc59e757b2f6be103896c4
parent bcbfee0a1777c301cd4b6e423b1212d718092355
Author: Karl Tarbe <karulont@gmail.com>
Date:   Wed,  7 Mar 2018 00:53:24 +0200

Fix memory leak when grabbing fails

Diffstat:
Mxcb.c | 6++++++
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/xcb.c b/xcb.c
@@ -203,6 +203,9 @@ bool grab_pointer_and_keyboard(xcb_connection_t *conn, xcb_screen_t *screen, xcb
             break;
         }
 
+        /* In case the grab failed, we still need to free the reply */
+        free(preply);
+
         /* Make this quite a bit slower */
         usleep(50);
 
@@ -237,6 +240,9 @@ bool grab_pointer_and_keyboard(xcb_connection_t *conn, xcb_screen_t *screen, xcb
             break;
         }
 
+        /* In case the grab failed, we still need to free the reply */
+        free(kreply);
+
         /* Make this quite a bit slower */
         usleep(50);