History

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

Guo, Yejun committed 5 years ago

Commit df59ae81 parent 41f4af11 file · +7 −9Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/dnn/dnn_backend_openvino.c+7−9
@@ -353,25 +353,23 @@ static DNNReturnType init_model_ov(OVModel *ov_model, const char *input_name, co · 352 unmodified lines
353353 goto err;
354354 }
355355
356+ item->callback.completeCallBackFunc = infer_completion_callback;
357+ item->callback.args = item;
358+ if (ff_safe_queue_push_back(ov_model->request_queue, item) < 0) {
359+ av_freep(&item);
360+ goto err;
361+ }
362+
356363 status = ie_exec_network_create_infer_request(ov_model->exe_network, &item->infer_request);
357364 if (status != OK) {
358− av_freep(&item);
359365 goto err;
360366 }
361367
362368 item->tasks = av_malloc_array(ctx->options.batch_size, sizeof(*item->tasks));
363369 if (!item->tasks) {
364− av_freep(&item);
365370 goto err;
366371 }
367372 item->task_count = 0;
368−
369− item->callback.completeCallBackFunc = infer_completion_callback;
370− item->callback.args = item;
371− if (ff_safe_queue_push_back(ov_model->request_queue, item) < 0) {
372− av_freep(&item);
373− goto err;
374− }
375373 }
376374
377375 ov_model->task_queue = ff_queue_create();

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