[PATCH v2 17/25] [libx11] The rest of the code uses goto's to free memory allocated later and prevent memory leaks, but there were several paths were property_return was free'd just before a goto.

Alan Coopersmith alan.coopersmith at oracle.com
Tue Feb 1 00:03:37 PST 2011


On 01/31/11 04:02 AM, Erkki Seppälä wrote:
> From: Ander Conselvan de Oliveira <ander.conselvan-de-oliveira at nokia.com>
> 
> xcms/LRGB: Add a label for freeing property_return.

That's a much better subject/shortlog line than the far too long one you have
there now.

> @@ -789,8 +782,6 @@ LINEAR_RGB_InitSCCData(
>  #endif /* ALLDEBUG */
>      }
>  
> -    Xfree ((char *)property_return);
> -
>      /* Free the old memory and use the new structure created. */
>      LINEAR_RGB_FreeSCCData(pPerScrnInfo->screenData);

Don't you need to leave that one there since you return(XcmsSuccess);
in that case, without going down through the Free* / return(XcmsFailure) path?


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



More information about the xorg-devel mailing list