[PATCH 11/11] xfree86: fix memory leak in xf86LoadModules

Nicolas PENINGUY nico at lostgeeks.org
Fri Mar 25 16:02:58 PDT 2011


On Fri, 2011-03-25 at 20:41 +0200, Tiago Vignatti wrote:
> diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
> index e664ce4..d81303e 100644
> --- a/hw/xfree86/common/xf86Init.c
> +++ b/hw/xfree86/common/xf86Init.c
> @@ -1433,6 +1433,7 @@ xf86LoadModules(char **list, pointer *optlist)
>  	}
>  	free(name);
>      }
> +    free(name);
>      return !failed;
>  }

This one seems wrong to me, the only leak I can see is when
*name == '\0'.

This patch might lead to double free I think.

Nicolas




More information about the xorg-devel mailing list