[FFmpeg-devel] [PATCH V1 3/3] lavf/hlsenc: fix memory leak

Jun Zhao mypopydev at gmail.com
Sat Oct 12 04:14:40 EEST 2019


From: Jun Zhao <barryjzhao at tencent.com>

fix memory leak

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

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index cd43201..5a27b0f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -585,6 +585,8 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
             av_strlcpy(sub_path, vtt_dirname, sub_path_size);
             av_strlcat(sub_path, segment->sub_filename, sub_path_size);
 
+            av_freep(&vtt_dirname);
+
             if (hls->method || (proto && !av_strcasecmp(proto, "http"))) {
                 av_dict_set(&options, "method", "DELETE", 0);
                 if ((ret = vs->vtt_avf->io_open(vs->vtt_avf, &out, sub_path, AVIO_FLAG_WRITE, &options)) < 0) {
-- 
1.7.1



More information about the ffmpeg-devel mailing list