[FFmpeg-devel] [PATCH] ffserver: Fix memory leak and uncheked av_strdup return

Reynaldo H. Verdejo Pinochet reynaldo at osg.samsung.com
Tue Nov 24 04:26:22 CET 2015



On 11/22/2015 11:10 AM, wm4 wrote:
> [..]
> 
> The function that's called here is generated by:
> 
> MAKE_ACCESSORS(AVStream, stream, char *, recommended_encoder_configuration)
> 
> This just copies the pointer. So I guess freeing it would generate a
> dangling pointer? And if the field was already set, you need to get and
> free the previous pointer?
> 
> (If this is correct, neither code makes sense. I must be missing
> something.)

Confused too. Will double check but in the mean time, I think it
would make sense to avoid calling get_recommended_() twice while
we are at this. The check and re-get seems racy although it might
not matter much in this context.

Bests,


-- 
Reynaldo H. Verdejo Pinochet
Open Source Group
Samsung Research America / Silicon Valley


More information about the ffmpeg-devel mailing list