XStringToKeysym: Check strdup() return value

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Keith Packard <keithp@keithp.com>
This commit is contained in:
Daniel Stone 2010-07-08 16:49:51 +01:00
parent cffa71b4a5
commit bea0873caf

View file

@ -159,6 +159,8 @@ XStringToKeysym(_Xconst char *s)
if (strncmp(s, "XF86_", 5) == 0) {
KeySym ret;
char *tmp = strdup(s);
if (!tmp)
return NoSymbol;
memmove(&tmp[4], &tmp[5], strlen(s) - 5 + 1);
ret = XStringToKeysym(tmp);
free(tmp);