[FFmpeg-cvslog] lavf/hlsenc: free the old_filname to avoid memory leak

Jun Zhao git at videolan.org
Tue Aug 20 03:59:23 EEST 2019


ffmpeg | branch: master | Jun Zhao <barryjzhao at tencent.com> | Mon Aug 19 21:01:07 2019 +0800| [f36925201c591015b1fbd366df71317f0290cef2] | committer: Steven Liu

lavf/hlsenc: free the old_filname to avoid memory leak

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

Reviewed-by: Steven Liu <lq at onvideo.cn>
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f36925201c591015b1fbd366df71317f0290cef2
---

 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 149b2a3bd0..01c24b3458 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;
             }
         }



More information about the ffmpeg-cvslog mailing list