[FFmpeg-cvslog] lavfi/anequalizer: fix memory leak in error handling path

Jun Zhao git at videolan.org
Wed Sep 11 05:49:00 EEST 2019


ffmpeg | branch: master | Jun Zhao <barryjzhao at tencent.com> | Tue Sep 10 18:24:08 2019 +0800| [44b55a8c9c87cd54b404dbf0b1d716eeec5357e6] | committer: Jun Zhao

lavfi/anequalizer: fix memory leak in error handling path

free the pad.name in error handling path to avoid memory leak.

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Jun Zhao <barryjzhao at tencent.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=44b55a8c9c87cd54b404dbf0b1d716eeec5357e6
---

 libavfilter/af_anequalizer.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_anequalizer.c b/libavfilter/af_anequalizer.c
index 03d939f170..ee82474083 100644
--- a/libavfilter/af_anequalizer.c
+++ b/libavfilter/af_anequalizer.c
@@ -205,8 +205,10 @@ static av_cold int init(AVFilterContext *ctx)
             .type         = AVMEDIA_TYPE_VIDEO,
             .config_props = config_video,
         };
-        if (!vpad.name)
+        if (!vpad.name) {
+            av_freep(&pad.name);
             return AVERROR(ENOMEM);
+        }
     }
 
     ret = ff_insert_outpad(ctx, 0, &pad);



More information about the ffmpeg-cvslog mailing list