[x264-devel] [patch] Fix memoryleaks on some functions fail situations

BugMaster BugMaster at narod.ru
Tue Sep 2 12:15:31 CEST 2008


On Mon, 1 Sep 2008 22:14:19 -0600 (MDT), Loren Merritt wrote:
> On Tue, 2 Sep 2008, BugMaster wrote:

>> Free resourses allocated by some functions (x264_encoder_open,
>> x264_ratecontrol_new, etc.) when they fail. Doesn't important for CLI
>> version of encoder but can be useful when x264 used as library.
>>
>> Patch need recheck because I don't test all situations and may be some
>> simplification by macroses because there are a lot of repeated code.

> Make an unwind section of the function, with frees in reverse order, and
> jump into the appropriate location.
> No way am I spending 200 loc on unnecessary error conditions.

> --Loren Merritt
> _______________________________________________
> x264-devel mailing list
> x264-devel at videolan.org
> http://mailman.videolan.org/listinfo/x264-devel

Here is variant with unwind sections.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: x264_error_memoryleaks.02.r956.diff
Url: http://mailman.videolan.org/pipermail/x264-devel/attachments/20080902/e254a06c/attachment.txt 


More information about the x264-devel mailing list