From b462de243a5364e6d6d4b07dced941d741f0ad7a Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Wed, 24 Jan 2018 23:14:20 +0100 Subject: Fix memory leak (P.S. I hate XCB's memory management) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- xkbdbind.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xkbdbind.c b/xkbdbind.c index 6df0520..f012df3 100644 --- a/xkbdbind.c +++ b/xkbdbind.c @@ -134,7 +134,7 @@ main(int argc, char *argv[]) next_e = xcb_poll_for_event(xconn); if (suppress > 0) { suppress = 0; - continue; + goto next; } switch (e->response_type & ~0x80) { case XCB_KEY_RELEASE: @@ -157,6 +157,8 @@ main(int argc, char *argv[]) } break; } + next: + free(e); } perror(argv0); -- cgit v1.2.3-70-g09d2