On 01/31/11 02:03 AM, Erkki Seppälä wrote: > 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ä <[email protected]> > > diff --git a/src/xkb/XKBGAlloc.c b/src/xkb/XKBGAlloc.c > index 17d13be..90ec2f9 100644 > --- a/src/xkb/XKBGAlloc.c > +++ b/src/xkb/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;
Reviewed-by: Alan Coopersmith <[email protected]> -- -Alan Coopersmith- [email protected] Oracle Solaris Platform Engineering: X Window System _______________________________________________ [email protected]: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
