[PATCH 32/32] [libx11] Cannot reach dead statement "return NULL; "
Alan Coopersmith
alan.coopersmith at oracle.com
Thu Jan 27 00:30:49 PST 2011
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 <ander.conselvan-de-oliveira at nokia.com>
> Signed-off-by: Erkki Seppälä <erkki.seppala at vincit.fi>
> ---
> 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- alan.coopersmith at oracle.com
Oracle Solaris Platform Engineering: X Window System
More information about the xorg-devel
mailing list