[FFmpeg-devel] [PATCH 4/5] lavfi/dnn_backend_openvino.c: fix mem leak for RequestItem upon error
Guo, Yejun
yejun.guo at intel.com
Sat Mar 13 08:28:54 EET 2021
---
libavfilter/dnn/dnn_backend_openvino.c | 16 +++++++---------
1 file changed, 7 insertions(+), 9 deletions(-)
diff --git a/libavfilter/dnn/dnn_backend_openvino.c b/libavfilter/dnn/dnn_backend_openvino.c
index 50de6a996e..55cb0c757e 100644
--- a/libavfilter/dnn/dnn_backend_openvino.c
+++ b/libavfilter/dnn/dnn_backend_openvino.c
@@ -353,25 +353,23 @@ static DNNReturnType init_model_ov(OVModel *ov_model, const char *input_name, co
goto err;
}
+ item->callback.completeCallBackFunc = infer_completion_callback;
+ item->callback.args = item;
+ if (ff_safe_queue_push_back(ov_model->request_queue, item) < 0) {
+ av_freep(&item);
+ goto err;
+ }
+
status = ie_exec_network_create_infer_request(ov_model->exe_network, &item->infer_request);
if (status != OK) {
- av_freep(&item);
goto err;
}
item->tasks = av_malloc_array(ctx->options.batch_size, sizeof(*item->tasks));
if (!item->tasks) {
- av_freep(&item);
goto err;
}
item->task_count = 0;
-
- item->callback.completeCallBackFunc = infer_completion_callback;
- item->callback.args = item;
- if (ff_safe_queue_push_back(ov_model->request_queue, item) < 0) {
- av_freep(&item);
- goto err;
- }
}
ov_model->task_queue = ff_queue_create();
--
2.17.1
More information about the ffmpeg-devel
mailing list