[FFmpeg-devel] [PATCH v1 02/11] avformat/hlsenc: fix memleak of vtt_dirname_r in hls_delete_old_segments

Steven Liu lq at chinaffmpeg.org
Wed Oct 9 10:35:21 EEST 2019


Signed-off-by: Steven Liu <lq at chinaffmpeg.org>
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index a1c03dbed5..a689acc2e0 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -575,6 +575,7 @@ static int hls_delete_old_segments(AVFormatContext *s, HLSContext *hls,
         if ((segment->sub_filename[0] != '\0')) {
             char *vtt_dirname_r = av_strdup(vs->vtt_avf->url);
             vtt_dirname = (char*)av_dirname(vtt_dirname_r);
+            av_freep(&vtt_dirname_r);
             sub_path_size = strlen(segment->sub_filename) + 1 + strlen(vtt_dirname);
             sub_path = av_malloc(sub_path_size);
             if (!sub_path) {
-- 
2.15.1





More information about the ffmpeg-devel mailing list