mirror of
https://gitlab.freedesktop.org/xorg/lib/libx11.git
synced 2026-05-24 00:58:14 +02:00
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>
This commit is contained in:
parent
6a4d027284
commit
690f8bffd4
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue