Commit 7443fea6 authored by Ulrich Sibiller's avatar Ulrich Sibiller

Keyboard.c: fix possible NULL pointer dereference

found by PVS Studio: "V522 There might be dereferencing of a potential null pointer 'keymap'."
parent e664d820
......@@ -435,6 +435,11 @@ N/A
int len = (max_keycode - min_keycode + 1) * mapWidth;
keymap = (KeySym *)malloc(len * sizeof(KeySym));
if (keymap == NULL)
{
XFreeModifiermap(modifier_keymap);
return -1;
}
for(int i = 0; i < len; ++i)
{
keymap[i] = keymap64[i];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment