[FFmpeg-devel] [PATCH] avfilter/formats: fix leak of channel_layouts on error

Paul B Mahol onemda at gmail.com
Tue Jan 5 20:16:10 CET 2016


On 1/5/16, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
> On Tue, Jan 5, 2016 at 11:06 AM, Paul B Mahol <onemda at gmail.com> wrote:
>> On 1/2/16, Ganesh Ajjanagadde <gajjanag at mit.edu> wrote:
>> [...]
>>>
>>> Thanks a lot for addressing this. But a client may not necessarily
>>> attempt initialization of the channel layouts first, so instead of
>>> do_nothing calls, shouldn't there be an equivalent for
>>> AVFilterFormats*?
>>>
>>> Of course, the commit message will need rewording.
>>
>> After second look I see no need for this code, the present code already
>> frees all allocated memory.
>>
>> Whichever instructions you used to expose leaks were flawed.
>
> care to explain: I did not know valgrind (as well as coverity) had
> such simple bugs if you are indeed correct?

I didn't claim valgrind is buggy in this case, instead the way to
trigger leak is wrong.

The ->list translates to ->channel_layouts and its freed on error IIRC.


More information about the ffmpeg-devel mailing list