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

Submitted by Steven Liu on Aug. 21, 2019, 2:24 a.m.

Details

Message ID 20190821022425.30596-1-lq@chinaffmpeg.org
State Accepted
Commit 80d2a7f5c64f7a0f8534373e246066cf733c70d8
Headers show

Commit Message

Steven Liu Aug. 21, 2019, 2:24 a.m.
CID: 1452445
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Patch hide | download patch | download mbox

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);