From: Karl Tarbe Date: Tue, 6 Mar 2018 22:53:24 +0000 (+0200) Subject: Fix memory leak when grabbing fails X-Git-Tag: 2.11~4^2 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=refs%2Fpull%2F179%2Fhead;p=i3%2Fi3lock Fix memory leak when grabbing fails --- diff --git a/xcb.c b/xcb.c index 27a8dae..280be55 100644 --- 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);