summaryrefslogtreecommitdiff
path: root/keycodes.c
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2014-03-08 18:50:22 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2014-03-10 23:25:21 -0700
commit6c2d3b0891f7be6ef4895be75188aa1c6f530bfc (patch)
treebb78a9a3ed78b9e002ed4bd68628534c5ccd3bf6 /keycodes.c
parent50ebe95a32dc59b1de899ef08f72462055b04065 (diff)
downloadxorg-app-xkbcomp-6c2d3b0891f7be6ef4895be75188aa1c6f530bfc.tar.gz
Don't dereference the pointer whose allocation failed
Flagged by cppcheck 1.64: [app/xkbcomp/keycodes.c:264] -> [app/xkbcomp/keycodes.c:262]: (warning) Possible null pointer dereference: new - otherwise it is redundant to check it against null. [app/xkbcomp/keytypes.c:600] -> [app/xkbcomp/keytypes.c:597]: (warning) Possible null pointer dereference: old - otherwise it is redundant to check it against null. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'keycodes.c')
-rw-r--r--keycodes.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/keycodes.c b/keycodes.c
index 13579ec..22d9eae 100644
--- a/keycodes.c
+++ b/keycodes.c
@@ -261,7 +261,7 @@ AddIndicatorName(KeyNamesInfo * info, IndicatorNameInfo * new)
new = NextIndicatorName(info);
if (!new)
{
- WSGO1("Couldn't allocate name for indicator %d\n", new->ndx);
+ WSGO1("Couldn't allocate name for indicator %d\n", old->ndx);
ACTION("Ignored\n");
return False;
}