summaryrefslogtreecommitdiff
path: root/libavformat/hlsenc.c
diff options
context:
space:
mode:
authorSteven Liu <lq@chinaffmpeg.org>2020-05-12 18:02:26 +0800
committerSteven Liu <lq@chinaffmpeg.org>2020-05-12 22:32:04 +0800
commit76eaca43be161377a370228b1debb2617c8d379b (patch)
treece8a37cd3ba72836877a861d7acf1be7dfcfbe5c /libavformat/hlsenc.c
parente684d07ac69fff2d5d638ce50637b58583df1a44 (diff)
downloadffmpeg-76eaca43be161377a370228b1debb2617c8d379b.tar.gz
avformat/hlsenc: fix filename memleak in hls_write_packet
Signed-off-by: Steven Liu <liuqi05@kuaishou.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 74cc220cd9..0abf5402a8 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2442,6 +2442,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
if (ret < 0) {
av_log(s, hls->ignore_io_errors ? AV_LOG_WARNING : AV_LOG_ERROR,
"Failed to open file '%s'\n", filename);
+ av_freep(&filename);
av_dict_free(&options);
return hls->ignore_io_errors ? 0 : ret;
}
@@ -2450,6 +2451,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
}
ret = flush_dynbuf(vs, &range_length);
if (ret < 0) {
+ av_freep(&filename);
av_dict_free(&options);
return ret;
}