[FFmpeg-devel,2/5] avformat:hlsenc.c: fix memory leak in fmp4 mode.

Submitted by Charles Liu on Oct. 11, 2018, 8:56 a.m.

Details

Message ID 20181011085647.81329-2-liuchh83@gmail.com
State New
Headers show

Commit Message

Charles Liu Oct. 11, 2018, 8:56 a.m.
Signed-off-by: Charles Liu <liuchh83@gmail.com>
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index 3ccd8756f6..c322b5a48f 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2205,6 +2205,7 @@  static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
                 avio_flush(oc->pb);
                 range_length = avio_close_dyn_buf(oc->pb, &buffer);
                 avio_write(vs->out, buffer, range_length);
+                av_free(buffer);
                 vs->init_range_length = range_length;
                 avio_open_dyn_buf(&oc->pb);
                 vs->packets_written = 0;