aboutsummaryrefslogtreecommitdiff
path: root/nx-X11/lib
diff options
context:
space:
mode:
authorErkki Seppälä <erkki.seppala@vincit.fi>2011-01-18 15:58:20 +0200
committerUlrich Sibiller <uli42@gmx.de>2016-10-19 21:40:25 +0200
commit29ad23b980bd03b0796a8f6cfaace347d9db213a (patch)
tree8e1d1bfe6edfd2a7f60be8b244e19e0f504f6884 /nx-X11/lib
parentbbeee4fd14a664bdf3b305fb7a959583db52241f (diff)
downloadnx-libs-29ad23b980bd03b0796a8f6cfaace347d9db213a.tar.gz
nx-libs-29ad23b980bd03b0796a8f6cfaace347d9db213a.tar.bz2
nx-libs-29ad23b980bd03b0796a8f6cfaace347d9db213a.zip
xkb: XkbPropertyPtr determined allocation success from wrong variables
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ä <erkki.seppala@vincit.fi> Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com> Backported-to-NX-by: Ulrich Sibiller <uli42@gmx.de>
Diffstat (limited to 'nx-X11/lib')
-rw-r--r--nx-X11/lib/X11/XKBGAlloc.c4
1 files changed, 2 insertions, 2 deletions
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;