]> git.sesse.net Git - ffmpeg/commit
avformat/hlsenc: Add deinit function
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Sun, 15 Dec 2019 10:00:02 +0000 (11:00 +0100)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Fri, 8 May 2020 13:17:46 +0000 (15:17 +0200)
commitfdb6f55209152b2a9b7e97758c8f26d7cb2dc669
tree476fe1801b6bf3b1f077a4854173d68494e60cb9
parent6825f7c0ba0e2021c47ef13440cefc49e50b0b5f
avformat/hlsenc: Add deinit function

This fixes memleaks in instances such as:
a) When an allocation fails at one of the two places in hls_init() where
the error is returned immediately without goto fail first.
b) When an error happens when writing the header.
c) When an allocation fails at one of the three places in
hls_write_trailer() where the error is returned immediately without goto
fail first.
d) When one decides not to write the trailer at all (e.g. because of
errors when writing packets).
Furthermore, it removes code duplication and allows to return
immediately, without goto fail first.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavformat/hlsenc.c