[PATCH 11/12] composite/xinerama: free overlayWin on error paths.

Alan Coopersmith alan.coopersmith at oracle.com
Thu Oct 20 15:57:50 PDT 2011


On 10/20/11 03:44, Dave Airlie wrote:
> From: Dave Airlie<airlied at redhat.com>
>
> pointed out by coverity scan.
>
> Signed-off-by: Dave Airlie<airlied at redhat.com>
> ---
>   composite/compext.c |    7 ++++++-
>   1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/composite/compext.c b/composite/compext.c
> index 01bd578..16daf23 100644
> --- a/composite/compext.c
> +++ b/composite/compext.c
> @@ -777,6 +777,7 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
>   	if (rc != Success)
>   	{
>   	    client->errorValue = stuff->window;
> +	    free(overlayWin);
>   	    return rc;
>   	}
>   	pScreen = pWin->drawable.pScreen;
> @@ -786,8 +787,10 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
>   	 * interest in the overlay window
>   	 */
>   	pOc = compCreateOverlayClient(pScreen, client);
> -	if (pOc == NULL)
> +	if (pOc == NULL) {
> +	    free(overlayWin);
>   	    return BadAlloc;
> +	}
>
>   	/*
>   	 * Make sure the overlay window exists
> @@ -797,6 +800,7 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
>   	    if (!compCreateOverlayWindow(pScreen))
>   	    {
>   		FreeResource (pOc->resource, RT_NONE);
> +	        free(overlayWin);
>   		return BadAlloc;
>   	    }
>
> @@ -807,6 +811,7 @@ PanoramiXCompositeGetOverlayWindow (ClientPtr client)
>   	if (rc != Success)
>   	{
>   	    FreeResource (pOc->resource, RT_NONE);
> +	    free(overlayWin);
>   	    return rc;
>   	}
>       }

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