]> git.sesse.net Git - ffmpeg/commitdiff
lavf/hlsenc: fix memory leak
authorJun Zhao <barryjzhao@tencent.com>
Fri, 11 Oct 2019 16:47:25 +0000 (00:47 +0800)
committerJun Zhao <barryjzhao@tencent.com>
Fri, 18 Oct 2019 01:58:50 +0000 (09:58 +0800)
fix memory leak

Reviewed-by: Steven Liu <lq@chinaffmpeg.org>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
libavformat/hlsenc.c

index cd4320114ddf60dea532d4d2a266d3e5e0604bc3..5a27b0f65709caa6522f748829f1ca56f6138c61 100644 (file)
@@ -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) {