aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib/X11
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2013-12-26 09:26:13 -0800
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:29 +0200
commit101419b10ea0fcaf9b3e48d733a510f27f827919 (patch)
treebf52eaa217dbe6493abcd66959e9114655542a77 /nx-X11/lib/X11
parent1b0df5da6d70f306db248907bdf65fe2e3ba4005 (diff)
downloadnx-libs-101419b10ea0fcaf9b3e48d733a510f27f827919.tar.gz
nx-libs-101419b10ea0fcaf9b3e48d733a510f27f827919.tar.bz2
nx-libs-101419b10ea0fcaf9b3e48d733a510f27f827919.zip
_XkbReadGeomOverlay: check for NULL first, then use pointer
Flagged by cppcheck 1.62: [lib/libX11/nx-X11/lib/X11/XKBGeom.c:479] -> [lib/libX11/nx-X11/lib/X11/XKBGeom.c:480]: (warning) Possible null pointer dereference: row - otherwise it is redundant to check it against null. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib/X11')
-rw-r--r--nx-X11/lib/X11/XKBGeom.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/nx-X11/lib/X11/XKBGeom.c b/nx-X11/lib/X11/XKBGeom.c
index 1014c9adb..0145da8c1 100644
--- a/nx-X11/lib/X11/XKBGeom.c
+++ b/nx-X11/lib/X11/XKBGeom.c
@@ -476,9 +476,9 @@ _XkbReadGeomOverlay(XkbReadBufferPtr buf,
if (rowWire == NULL)
return BadLength;
row = XkbAddGeomOverlayRow(ol, rowWire->rowUnder, rowWire->nKeys);
- row->row_under = rowWire->rowUnder;
if (!row)
return BadAlloc;
+ row->row_under = rowWire->rowUnder;
if (rowWire->nKeys < 1)
continue;
keyWire = (xkbOverlayKeyWireDesc *)