diff mbox series

[FFmpeg-devel,v2,1/8] avfilter/dnn_filter_common: fix memleak

Message ID tencent_6A582DC49A4B404A9A569FFBAB4E4E267008@qq.com
State New
Headers show
Series [FFmpeg-devel,v2,1/8] avfilter/dnn_filter_common: fix memleak | expand

Checks

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

Commit Message

Zhao Zhili Sept. 2, 2023, 8:23 a.m. UTC
From: Zhao Zhili <zhilizhao@tencent.com>

Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
---
 libavfilter/dnn_filter_common.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff mbox series

Patch

diff --git a/libavfilter/dnn_filter_common.c b/libavfilter/dnn_filter_common.c
index d175c91914..3b9182c1d1 100644
--- a/libavfilter/dnn_filter_common.c
+++ b/libavfilter/dnn_filter_common.c
@@ -159,4 +159,10 @@  void ff_dnn_uninit(DnnContext *ctx)
     if (ctx->dnn_module) {
         (ctx->dnn_module->free_model)(&ctx->model);
     }
+    if (ctx->model_outputnames) {
+        for (int i = 0; i < ctx->nb_outputs; i++)
+            av_free(ctx->model_outputnames[i]);
+
+        av_freep(&ctx->model_outputnames);
+    }
 }