[FFmpeg-devel] [PATCH V1 5/5] lavf/hlsenc: free the old_filname to avoid memory leak

Liu Steven lq at chinaffmpeg.org
Tue Aug 20 04:39:53 EEST 2019



> 在 2019年8月19日,下午9:01,Jun Zhao <mypopydev at gmail.com> 写道:
> 
> From: Jun Zhao <barryjzhao at tencent.com>
> 
> free the old_filname to avoid memory leak in error handle
> path.
> 
> Signed-off-by: Jun Zhao <barryjzhao at tencent.com>
> ---
> libavformat/hlsenc.c |    1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index f6f9c81..9099c84 100644
> --- a/libavformat/hlsenc.c
> +++ b/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;
>             }
>         }
> -- 
> 1.7.1
> 
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 
> To unsubscribe, visit link above, or email
> ffmpeg-devel-request at ffmpeg.org with subject "unsubscribe".

LGTM  applied


Thanks
Steven



More information about the ffmpeg-devel mailing list