diff mbox series

[FFmpeg-devel,2/3] avformat/hlsenc: fix filename memleak in hls_write_packet

Message ID 20200508103359.65143-2-lq@chinaffmpeg.org
State Accepted
Headers show
Series [FFmpeg-devel,1/3] avformat/hlsenc: move number out of hls_start | expand

Checks

Context Check Description
andriy/default pending
andriy/make success Make finished
andriy/make_fate success Make fate finished

Commit Message

Liu Steven May 8, 2020, 10:33 a.m. UTC
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
---
 libavformat/hlsenc.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox series

Patch

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index bcc67b1159..307aba2efa 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2447,6 +2447,7 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
                     av_log(s, hls->ignore_io_errors ? AV_LOG_WARNING : AV_LOG_ERROR,
                            "Failed to open file '%s'\n", filename);
                     av_dict_free(&options);
+                    av_freep(&filename);
                     return hls->ignore_io_errors ? 0 : ret;
                 }
                 if (hls->segment_type == SEGMENT_TYPE_FMP4) {
@@ -2454,6 +2455,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;
                 }