Re: [FFmpeg-devel] [PATCH] libavformat/hlsenc: fix a memory leak in libavformat/hlsenc.c

2024-04-15 Thread Steven Liu
LuMingYin  于2024年4月13日周六 14:35写道:
>
> In the function 'hls_write_trailer' in the file 
> '/FFmpeg/libavformat/hlsenc.c', the variable named 'options' allocates a 
> block of dynamic memory in the 'av_dict_set' function, which is not freed on 
> error paths.
>
> Signed-off-by: LuMingYin 
> ---
>  libavformat/hlsenc.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
> index bde7230036..0e2843c6bc 100644
> --- a/libavformat/hlsenc.c
> +++ b/libavformat/hlsenc.c
> @@ -2757,6 +2757,7 @@ static int hls_write_trailer(struct AVFormatContext *s)
>  filename = av_asprintf("%s", oc->url);
>  }
>  if (!filename) {
> +av_dict_free(&options);
>  av_freep(&old_filename);
>  return AVERROR(ENOMEM);
>  }
> --
> 2.25.1
>
> ___
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
>
> To unsubscribe, visit link above, or email
> ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".

LGTM



Thanks
Steven
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".


[FFmpeg-devel] [PATCH] libavformat/hlsenc: fix a memory leak in libavformat/hlsenc.c

2024-04-12 Thread LuMingYin
In the function 'hls_write_trailer' in the file '/FFmpeg/libavformat/hlsenc.c', 
the variable named 'options' allocates a block of dynamic memory in the 
'av_dict_set' function, which is not freed on error paths.

Signed-off-by: LuMingYin 
---
 libavformat/hlsenc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/hlsenc.c b/libavformat/hlsenc.c
index bde7230036..0e2843c6bc 100644
--- a/libavformat/hlsenc.c
+++ b/libavformat/hlsenc.c
@@ -2757,6 +2757,7 @@ static int hls_write_trailer(struct AVFormatContext *s)
 filename = av_asprintf("%s", oc->url);
 }
 if (!filename) {
+av_dict_free(&options);
 av_freep(&old_filename);
 return AVERROR(ENOMEM);
 }
-- 
2.25.1

___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-requ...@ffmpeg.org with subject "unsubscribe".