avformat/hlsenc.c: fix memory leak in fmp4 mode.

Signed-off-by: Charles Liu <liuchh83@gmail.com>
Signed-off-by: Steven Liu <lq@chinaffmpeg.org>
This commit is contained in:
Charles Liu 2018-10-30 11:08:29 +08:00 committed by Steven Liu
parent 3d1b795493
commit e9dbd62cb5

View 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;