lavf/hlsenc: free the old_filname to avoid memory leak

free the old_filname to avoid memory leak in error handle
path.

Reviewed-by: Steven Liu <lq@onvideo.cn>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
This commit is contained in:
Jun Zhao 2019-08-19 21:01:07 +08:00 committed by Steven Liu
parent eccb94c3ba
commit f36925201c
1 changed files with 1 additions and 0 deletions

View File

@ -2428,6 +2428,7 @@ static int hls_write_packet(AVFormatContext *s, AVPacket *pkt)
// if we're building a VOD playlist, skip writing the manifest multiple times, and just wait until the end
if (hls->pl_type != PLAYLIST_TYPE_VOD) {
if ((ret = hls_window(s, 0, vs)) < 0) {
av_free(old_filename);
return ret;
}
}