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

next
Michael Stapelberg 2009-08-27 21:33:19 +02:00
parent 39f002e0b1
commit 39457338e4
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
/* For now, we only use the first keysymbol. */
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;
free(numlock_syms);
#endif