avformat/hlsenc: fix memleak of filename
authorSteven Liu <lq@chinaffmpeg.org>
Wed, 21 Aug 2019 02:24:25 +0000 (10:24 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Mon, 26 Aug 2019 03:06:36 +0000 (11:06 +0800)
CID: 1452445
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index 3c873e5..03b06ca 100644 (file)
@@ -2579,9 +2579,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);