Browse Source

lavfi/dnn_backend_openvino.c: fix mem leak for TaskItem upon error

tags/n4.4
Guo, Yejun 5 years ago
parent
commit
da12d600ea
1 changed files with 6 additions and 6 deletions
  1. +6
    -6
      libavfilter/dnn/dnn_backend_openvino.c

+ 6
- 6
libavfilter/dnn/dnn_backend_openvino.c View File

@@ -678,12 +678,6 @@ DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, const char *i
return DNN_ERROR;
}

task = av_malloc(sizeof(*task));
if (!task) {
av_log(ctx, AV_LOG_ERROR, "unable to alloc memory for task item.\n");
return DNN_ERROR;
}

if (!ov_model->exe_network) {
if (init_model_ov(ov_model, input_name, output_names[0]) != DNN_SUCCESS) {
av_log(ctx, AV_LOG_ERROR, "Failed init OpenVINO exectuable network or inference request\n");
@@ -691,6 +685,12 @@ DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, const char *i
}
}

task = av_malloc(sizeof(*task));
if (!task) {
av_log(ctx, AV_LOG_ERROR, "unable to alloc memory for task item.\n");
return DNN_ERROR;
}

task->done = 0;
task->do_ioproc = 1;
task->async = 1;


Loading…
Cancel
Save