i3lock-color

The world's most popular non-default computer lockscreen.
Index Commits Files Refs README LICENSE
commit ae72b675ca4f104fc210e5ad476a8b91acf6beb3
parent bcbfee0a1777c301cd4b6e423b1212d718092355
Author: Ingo Bürk <admin@airblader.de>
Date:   Mon, 19 Mar 2018 14:37:37 +0100

Merge pull request #179 from karulont/master

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);