From 29ad23b980bd03b0796a8f6cfaace347d9db213a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erkki=20Sepp=C3=A4l=C3=A4?= Date: Tue, 18 Jan 2011 15:58:20 +0200 Subject: xkb: XkbPropertyPtr determined allocation success from wrong variables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cannot reach dead statement "return NULL;" Check for the NULLness of prop->name and prop->value instead of name and value, which was checked earlier anyway. Decided against using strdup due to curious memory allocation functions and the rest of the xkb not using it either. Signed-off-by: Erkki Seppälä Reviewed-by: Alan Coopersmith Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/XKBGAlloc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'nx-X11/lib/X11/XKBGAlloc.c') diff --git a/nx-X11/lib/X11/XKBGAlloc.c b/nx-X11/lib/X11/XKBGAlloc.c index 46b997b7f..489d41b78 100644 --- a/nx-X11/lib/X11/XKBGAlloc.c +++ b/nx-X11/lib/X11/XKBGAlloc.c @@ -696,11 +696,11 @@ register XkbPropertyPtr prop; } prop= &geom->properties[geom->num_properties]; prop->name= (char *)_XkbAlloc(strlen(name)+1); - if (!name) + if (!prop->name) return NULL; strcpy(prop->name,name); prop->value= (char *)_XkbAlloc(strlen(value)+1); - if (!value) { + if (!prop->value) { _XkbFree(prop->name); prop->name= NULL; return NULL; -- cgit v1.2.3