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>
pull/321/head^2
Jun Zhao 5 years ago committed by Steven Liu
parent eccb94c3ba
commit f36925201c
  1. 1
      libavformat/hlsenc.c

@ -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;
}
}

Loading…
Cancel
Save