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
678678 return DNN_ERROR;
679679 }
680680
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−
687681 if (!ov_model->exe_network) {
688682 if (init_model_ov(ov_model, input_name, output_names[0]) != DNN_SUCCESS) {
689683 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
691685 }
692686 }
693687
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+
694694 task->done = 0;
695695 task->do_ioproc = 1;
696696 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