[PATCH 32/32] [libx11] Cannot reach dead statement "return NULL; "
walter harms
wharms at bfs.de
Thu Jan 27 01:42:08 PST 2011
Am 27.01.2011 08:54, schrieb Erkki Seppälä:
> 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) {
it looks like a case for strdup() here.
re,
wh
More information about the xorg-devel
mailing list