[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.

Ander Conselvan de Oliveira ander.conselvan-de-oliveira at nokia.com
Tue Feb 1 01:04:28 PST 2011


On 02/01/2011 10:03 AM, ext Alan Coopersmith wrote:
> 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.

I agree with you and I actually wrote the commit message that way. Looks 
like Erkki changed it for some reason.


>> @@ -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?

I guess I got carried away with all the search and replace. I'll send a 
corrected version with the original commit message.

Thanks,
Ander



More information about the xorg-devel mailing list