[PATCHv3 14/14] xfree86: fix memory leak in xf86LoadModules

Alan Coopersmith alan.coopersmith at oracle.com
Tue Mar 29 14:22:51 PDT 2011


On 03/29/11 08:08 AM, Tiago Vignatti wrote:
> Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
> ---
> Alan, I guess you can S-o-b this one?
> 
>  hw/xfree86/common/xf86Init.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
> index e664ce4..0b36163 100644
> --- a/hw/xfree86/common/xf86Init.c
> +++ b/hw/xfree86/common/xf86Init.c
> @@ -1414,8 +1414,10 @@ xf86LoadModules(char **list, pointer *optlist)
>  	name = xf86NormalizeName(list[i]);
>  
>  	/* Skip empty names */
> -	if (name == NULL || *name == '\0')
> +	if (name == NULL || *name == '\0') {
> +	    free(name);
>  	    continue;
> +	}
>  
>  	/* Replace obsolete keyboard driver with kbd */
>  	if (!xf86NameCmp(name, "keyboard")) {

Sure,
Signed-off-by: Alan Coopersmith <alan.coopersmith at oracle.com>


-- 
	-Alan Coopersmith-        alan.coopersmith at oracle.com
	 Oracle Solaris Platform Engineering: X Window System



More information about the xorg-devel mailing list