]> git.sesse.net Git - ffmpeg/commit
avformat/hlsenc: Fix memleaks with repeating parameters
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Mon, 16 Dec 2019 00:04:13 +0000 (01:04 +0100)
committerSteven Liu <lq@chinaffmpeg.org>
Mon, 23 Dec 2019 06:05:51 +0000 (14:05 +0800)
commit5ba3a8958c76d5490bcc9ba4441f03bedd9aebc6
tree193bc117f87f5a92832c07f4a42c54f4342d2b49
parent53c1458bf2e91b2279985e5fc2ffaa5e2013564a
avformat/hlsenc: Fix memleaks with repeating parameters

When a parameter like e.g. language is contained more than once in the
part of var_stream_map pertaining to a single VariantStream, the later
one just overwrites the pointer to the earlier one, leading to a
memleak. This commit changes this by handling the situation gracefully:
The earlier string is silently freed first, so that the last one wins.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
Reviewed-by: Steven Liu <lq@onvideo.cn>
libavformat/hlsenc.c