]> git.sesse.net Git - ffmpeg/commitdiff
lavfi/anequalizer: fix memory leak in error handling path
authorJun Zhao <barryjzhao@tencent.com>
Tue, 10 Sep 2019 10:24:08 +0000 (18:24 +0800)
committerJun Zhao <barryjzhao@tencent.com>
Wed, 11 Sep 2019 02:36:34 +0000 (10:36 +0800)
free the pad.name in error handling path to avoid memory leak.

Reviewed-by: Paul B Mahol <onemda@gmail.com>
Signed-off-by: Jun Zhao <barryjzhao@tencent.com>
libavfilter/af_anequalizer.c

index 03d939f170d17ed21b4d297f1eedee63ef87e1c1..ee82474083e57a54eec0476c8c0cefbc91e02263 100644 (file)
@@ -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);