diff --git a/src/xcb/xcb.c b/src/xcb/xcb.c index 4ba56dc..7ab70e6 100644 --- a/src/xcb/xcb.c +++ b/src/xcb/xcb.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include @@ -288,9 +289,11 @@ void clean_xcb(void) { focus_window(XCB_WINDOW_NONE); clean_xcb_cursor(); clean_ewmh_extension(); + if (key_symbols) xcb_key_symbols_free(key_symbols); xcb_disconnect(conn); conn = NULL; screen = NULL; + key_symbols = NULL; } void grab_keybindings(const keybinding_t *keys, const size_t length) { @@ -310,6 +313,7 @@ void grab_keybindings(const keybinding_t *keys, const size_t length) { keycode = xcb_key_symbols_get_keycode(key_symbols, keysym); modifiers = keys[i].modifiers; cookie = xcb_grab_key(conn, key, root, modifiers, *keycode, mode, mode); + free(keycode); error = xcb_request_check(conn, cookie); if (error) { clean_xcb();