[PATCH 10/12] composite/xinerama: free newPix on error path.

Alan Coopersmith alan.coopersmith at oracle.com
Thu Oct 20 07:32:59 PDT 2011


On 10/20/11 03:44, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> newPix could be leaked if AddResource failed.
>
> pointed out by coverity scan.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   composite/compext.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/composite/compext.c b/composite/compext.c
> index 722587a..01bd578 100644
> --- a/composite/compext.c
> +++ b/composite/compext.c
> @@ -725,8 +725,10 @@ PanoramiXCompositeNameWindowPixmap (ClientPtr client)
>   	}
>
>   	if (!AddResource (newPix->info[i].id, RT_PIXMAP,
> -			  (pointer) pPixmap))
> +			  (pointer) pPixmap)) {
> +	    free (newPix);
>   	    return BadAlloc;
> +	}
>
>   	++pPixmap->refcnt;
>       }

Reviewed-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