diff mbox series

[FFmpeg-devel,v3,10/25] avfilter/af_lv2: Free inpad's name generically

Message ID PR3PR03MB66655BBFD939C44F2856536A8FC39@PR3PR03MB6665.eurprd03.prod.outlook.com
State Accepted
Commit f28db2ca277ac24fd549a6ab9beaf46872848df1
Headers show
Series [FFmpeg-devel,v3,01/25] avfilter/internal: Uninline ff_insert_(in|out)pad() | expand

Checks

Context Check Description
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Andreas Rheinhardt Aug. 22, 2021, 12:47 a.m. UTC
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
---
 libavfilter/af_lv2.c | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/af_lv2.c b/libavfilter/af_lv2.c
index 76a289434f..75c7494cc8 100644
--- a/libavfilter/af_lv2.c
+++ b/libavfilter/af_lv2.c
@@ -393,7 +393,7 @@  static av_cold int init(AVFilterContext *ctx)
     const LilvPlugin *plugin;
     AVFilterPad pad = { NULL };
     LilvNode *uri;
-    int i;
+    int i, ret;
 
     s->world = lilv_world_new();
     if (!s->world)
@@ -464,10 +464,8 @@  static av_cold int init(AVFilterContext *ctx)
             return AVERROR(ENOMEM);
 
         pad.filter_frame = filter_frame;
-        if (ff_append_inpad(ctx, &pad) < 0) {
-            av_freep(&pad.name);
-            return AVERROR(ENOMEM);
-        }
+        if ((ret = ff_append_inpad_free_name(ctx, &pad)) < 0)
+            return ret;
     }
 
     return 0;
@@ -562,9 +560,6 @@  static av_cold void uninit(AVFilterContext *ctx)
     av_freep(&s->maxes);
     av_freep(&s->controls);
     av_freep(&s->seq_out);
-
-    if (ctx->nb_inputs)
-        av_freep(&ctx->input_pads[0].name);
 }
 
 static const AVFilterPad lv2_outputs[] = {