diff options
author | Leandro Nini <drfiemost@email.it> | 2022-12-10 07:49:56 +0000 |
---|---|---|
committer | Leandro Nini <drfiemost@email.it> | 2022-12-10 09:35:43 +0100 |
commit | 931c469b2b91603c5c196abf65a39c7dab8609d7 (patch) | |
tree | 2a16653ceba35bccb2dddaa6dc479e3b94cf44aa /geometry.c | |
parent | 7bac6a25bb44d39710f1b2b5fdad56d7f4c01c39 (diff) |
Avoid possibly dereferencing null pointer
This addresses issue #21
Signed-off-by: Leandro Nini <drfiemost@email.it>
Diffstat (limited to 'geometry.c')
-rw-r--r-- | geometry.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -2569,12 +2569,15 @@ HandleOverlayDef(OverlayDef * def, keyDef = (OverlayKeyDef *) keyDef->common.next) { key = uTypedCalloc(1, OverlayKeyInfo); - if ((!key) && warningLevel > 0) + if (!key) { - WSGO("Couldn't allocate OverlayKeyInfo\n"); - ACTION("Overlay %s for section %s will be incomplete\n", - XkbAtomText(info->dpy, ol.name, XkbMessage), - scText(info->dpy, si)); + if (warningLevel > 0) + { + WSGO("Couldn't allocate OverlayKeyInfo\n"); + ACTION("Overlay %s for section %s will be incomplete\n", + XkbAtomText(info->dpy, ol.name, XkbMessage), + scText(info->dpy, si)); + } return False; } strncpy(key->over, keyDef->over, XkbKeyNameLength); |