From 101419b10ea0fcaf9b3e48d733a510f27f827919 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Thu, 26 Dec 2013 09:26:13 -0800 Subject: _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 Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/XKBGeom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'nx-X11/lib/X11/XKBGeom.c') 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 *) -- cgit v1.2.3