Bugfix: Don’t crash if the numlock symbol cannot be found (Thanks xeen)

This commit is contained in:
Michael Stapelberg 2009-08-27 21:33:19 +02:00
parent 1e94dc19ed
commit 3fc63c69df
1 changed files with 2 additions and 0 deletions

View File

@ -237,6 +237,8 @@ void xcb_get_numlock_mask(xcb_connection_t *conn) {
#else #else
/* For now, we only use the first keysymbol. */ /* For now, we only use the first keysymbol. */
xcb_keycode_t *numlock_syms = xcb_key_symbols_get_keycode(keysyms, XCB_NUM_LOCK); xcb_keycode_t *numlock_syms = xcb_key_symbols_get_keycode(keysyms, XCB_NUM_LOCK);
if (numlock_syms == NULL)
return;
xcb_keycode_t numlock = *numlock_syms; xcb_keycode_t numlock = *numlock_syms;
free(numlock_syms); free(numlock_syms);
#endif #endif