avformat/hlsenc.c: fix memory leak in fmp4 mode.
authorCharles Liu <liuchh83@gmail.com>
Tue, 30 Oct 2018 03:08:29 +0000 (11:08 +0800)
committerSteven Liu <lq@chinaffmpeg.org>
Tue, 30 Oct 2018 03:08:29 +0000 (11:08 +0800)
Signed-off-by: Charles Liu <liuchh83@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
libavformat/hlsenc.c

index 3ccd875..c322b5a 100644 (file)
@@ -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;