[FFmpeg-devel] [PATCH v1 2/3] avformat/hlsenc: fix memleak of filename

Steven Liu lq at chinaffmpeg.org
Wed Aug 21 05:24:25 EEST 2019


CID: 1452445
Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/hlsenc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index fbc6554b97..689e29edcc 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2580,9 +2580,8 @@ static int hls_write_trailer(struct AVFormatContext *s)
 
         vs->size = range_length;
         hlsenc_io_close(s, &vs->out, filename);
-        av_free(filename);
-
 failed:
+        av_free(filename);
         av_write_trailer(oc);
         if (oc->url[0]) {
             proto = avio_find_protocol_name(oc->url);
-- 
2.15.1






More information about the ffmpeg-devel mailing list