[FFmpeg-devel] [PATCH] avformat/hlsenc: fix memleak

Steven Liu lq at chinaffmpeg.org
Mon May 8 13:35:35 EEST 2017


fix memleak bug, when all the process is normal,
just free old_filename

Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/hlsenc.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 221089c..d62d5b8 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -1559,6 +1559,8 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
             av_free(old_filename);
             return ret;
         }
+
+        av_free(old_filename);
     }
 
     ret = ff_write_chained(oc, stream_index, pkt, s, 0);
-- 
1.7.1






More information about the ffmpeg-devel mailing list