summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorJun Zhao <barryjzhao@tencent.com>2019-10-12 00:47:25 +0800
committerJun Zhao <barryjzhao@tencent.com>2019-10-18 09:58:50 +0800
commitfeaec3bc3133ff143b8445c919f2c4c56048fdf9 (patch)
tree8644ebd7d8eebde49cfc06fe6283ed854239139b /libavformat/hlsenc.c
parented3c317deac933cfbc3c8f38a8930069b0847323 (diff)
lavf/hlsenc: fix memory leak
fix memory leak Reviewed-by: Steven Liu <lq@chinaffmpeg.org> Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
Diffstat (limited to 'libavformat/hlsenc.c')
-rw-r--r--libavformat/hlsenc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index cd4320114d..5a27b0f657 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) {