On 01/26/11 11:54 PM, Erkki Seppälä wrote:
> Removed superfluous check for NULL. name == NULL is already checked
> at the function entry.
>
> Reviewed-by: Ander Conselvan de Oliveira
> <[email protected]>
> Signed-off-by: Erkki Seppälä <[email protected]>
> ---
> src/xkb/XKBGAlloc.c | 2 --
> 1 files changed, 0 insertions(+), 2 deletions(-)
>
> diff --git a/src/xkb/XKBGAlloc.c b/src/xkb/XKBGAlloc.c
> index 17d13be..a1cce94 100644
> --- a/src/xkb/XKBGAlloc.c
> +++ b/src/xkb/XKBGAlloc.c
> @@ -696,8 +696,6 @@ register XkbPropertyPtr prop;
> }
> prop= &geom->properties[geom->num_properties];
> prop->name= (char *)_XkbAlloc(strlen(name)+1);
> - if (!name)
> - return NULL;
> strcpy(prop->name,name);
> prop->value= (char *)_XkbAlloc(strlen(value)+1);
> if (!value) {
Looks like that should instead be checking if (!prop->name) to
make sure the alloc didn't fail. Same for the following
if (!value) instead of if(!prop->value).
--
-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