Commit 29ad23b9 authored by Erkki Seppälä's avatar Erkki Seppälä Committed by Ulrich Sibiller

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: 's avatarErkki Seppälä <erkki.seppala@vincit.fi> Reviewed-by: Alan Coopersmith <alan.coopersmith at oracle.com> Backported-to-NX-by: 's avatarUlrich Sibiller <uli42@gmx.de>
parent bbeee4fd
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment