summaryrefslogtreecommitdiff
path: root/libavfilter
diff options
context:
space:
mode:
authorZhao Zhili <zhilizhao@tencent.com>2023-09-02 16:23:53 +0800
committerGuo Yejun <yejun.guo@intel.com>2023-09-15 13:02:15 +0800
commit5369548f2e55f7c90969c038f4066a2924168d6d (patch)
treeb9445dbfcf41528ada7dd7f4a540e275a7d76f28 /libavfilter
parent3e24a2776523866378ef16fbec7ca85291ddccd6 (diff)
avfilter/dnn_backend_openvino: fix multiple memleaks
Signed-off-by: Zhao Zhili <zhilizhao@tencent.com>
Diffstat (limited to 'libavfilter')
-rw-r--r--libavfilter/dnn/dnn_backend_openvino.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 4922833b07..951f179b7c 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -68,12 +68,12 @@ typedef struct OVModel{
ie_core_t *core;
ie_network_t *network;
ie_executable_network_t *exe_network;
+ const char *all_input_names;
+ const char *all_output_names;
#endif
SafeQueue *request_queue; // holds OVRequestItem
Queue *task_queue; // holds TaskItem
Queue *lltask_queue; // holds LastLevelTaskItem
- const char *all_input_names;
- const char *all_output_names;
} OVModel;
// one request for one call to openvino
@@ -508,7 +508,10 @@ static void dnn_free_model_ov(DNNModel **model)
ie_network_free(&ov_model->network);
if (ov_model->core)
ie_core_free(&ov_model->core);
+ av_free(ov_model->all_output_names);
+ av_free(ov_model->all_input_names);
#endif
+ av_opt_free(&ov_model->ctx);
av_freep(&ov_model);
av_freep(model);
}
@@ -1255,6 +1258,7 @@ static DNNModel *dnn_load_model_ov(const char *model_filename, DNNFunctionType f
goto err;
}
APPEND_STRING(ov_model->all_input_names, node_name)
+ ie_network_name_free(&node_name);
}
status = ie_network_get_outputs_number(ov_model->network, &node_count);
if (status != OK) {
@@ -1268,6 +1272,7 @@ static DNNModel *dnn_load_model_ov(const char *model_filename, DNNFunctionType f
goto err;
}
APPEND_STRING(ov_model->all_output_names, node_name)
+ ie_network_name_free(&node_name);
}
#endif