Remove redundant av_freep() to avoid double free since task will be freed in dnn_free_model_tf() after the success of ff_queue_push_back().
Unified · Split
| @@ -833,14 +833,12 @@ static int dnn_execute_model_tf(const DNNModel *model, DNNExecBaseParams *exec_p · 832 unmodified lines | ||
| 833 | 833 | |
| 834 | 834 | ret = extract_lltask_from_task(task, tf_model->lltask_queue); |
| 835 | 835 | if (ret != 0) { |
| 836 | − av_freep(&task); | |
| 837 | 836 | av_log(ctx, AV_LOG_ERROR, "unable to extract last level task from task.\n"); |
| 838 | 837 | return ret; |
| 839 | 838 | } |
| 840 | 839 | |
| 841 | 840 | request = ff_safe_queue_pop_front(tf_model->request_queue); |
| 842 | 841 | if (!request) { |
| 843 | − av_freep(&task); | |
| 844 | 842 | av_log(ctx, AV_LOG_ERROR, "unable to get infer request.\n"); |
| 845 | 843 | return AVERROR(EINVAL); |
| 846 | 844 | } |