[FFmpeg-devel] [PATCH V1 5/5] lavf/hlsenc: free the old_filname to avoid memory leak

Jun Zhao mypopydev at gmail.com
Mon Aug 19 16:01:07 EEST 2019


From: Jun Zhao <barryjzhao at tencent.com>

free the old_filname to avoid memory leak in error handle
path.

Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
---
 libavformat/hlsenc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index f6f9c81..9099c84 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2428,6 +2428,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
         // if we're building a VOD playlist, skip writing the manifest multiple times, and just wait until the end
         if (hls->pl_type != PLAYLIST_TYPE_VOD) {
             if ((ret = hls_window(s, 0, vs)) < 0) {
+                av_free(old_filename);
                 return ret;
             }
         }
-- 
1.7.1



More information about the ffmpeg-devel mailing list