History

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

Guo, Yejun committed 5 years ago

Commit da12d601 parent df59ae81 file · +6 −6Browse files

Unified · Split

libavfilter/dnn/dnn_backend_openvino.c+6−6
@@ -678,12 +678,6 @@ DNNReturnType ff_dnn_execute_model_async_ov(const DNNModel *model, const char *i · 677 unmodified lines
678 return DNN_ERROR;678 return DNN_ERROR;
679 }679 }
680 680
681 task = av_malloc(sizeof(*task));
682 if (!task) {
683 av_log(ctx, AV_LOG_ERROR, "unable to alloc memory for task item.\n");
684 return DNN_ERROR;
685 }
686
687 if (!ov_model->exe_network) {681 if (!ov_model->exe_network) {
688 if (init_model_ov(ov_model, input_name, output_names[0]) != DNN_SUCCESS) {682 if (init_model_ov(ov_model, input_name, output_names[0]) != DNN_SUCCESS) {
689 av_log(ctx, AV_LOG_ERROR, "Failed init OpenVINO exectuable network or inference request\n");683 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 · 1 unmodified line
691 }685 }
692 }686 }
693 687
688 task = av_malloc(sizeof(*task));
689 if (!task) {
690 av_log(ctx, AV_LOG_ERROR, "unable to alloc memory for task item.\n");
691 return DNN_ERROR;
692 }
693
694 task->done = 0;694 task->done = 0;
695 task->do_ioproc = 1;695 task->do_ioproc = 1;
696 task->async = 1;696 task->async = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t