From: Jun Zhao <barryjz...@tencent.com>

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

Signed-off-by: Jun Zhao <barryjz...@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

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

Reply via email to