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

Loren Merritt lorenm at u.washington.edu
Tue Sep 2 06:14:19 CEST 2008


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


More information about the x264-devel mailing list