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().
Showing the changes to libavfilter (1 of 1 file). Show all
Unified · Split
| @@ -833,14 +833,12 @@ static int dnn_execute_model_tf(const DNNModel *model, DNNExecBaseParams *exec_p · 832 unmodified lines | |||
| 833 | 833 | ||
| 834 | ret = extract_lltask_from_task(task, tf_model->lltask_queue); | 834 | ret = extract_lltask_from_task(task, tf_model->lltask_queue); |
| 835 | if (ret != 0) { | 835 | if (ret != 0) { |
| 836 | av_freep(&task); | ||
| 837 | av_log(ctx, AV_LOG_ERROR, "unable to extract last level task from task.\n"); | 836 | av_log(ctx, AV_LOG_ERROR, "unable to extract last level task from task.\n"); |
| 838 | return ret; | 837 | return ret; |
| 839 | } | 838 | } |
| 840 | 839 | ||
| 841 | request = ff_safe_queue_pop_front(tf_model->request_queue); | 840 | request = ff_safe_queue_pop_front(tf_model->request_queue); |
| 842 | if (!request) { | 841 | if (!request) { |
| 843 | av_freep(&task); | ||
| 844 | av_log(ctx, AV_LOG_ERROR, "unable to get infer request.\n"); | 842 | av_log(ctx, AV_LOG_ERROR, "unable to get infer request.\n"); |
| 845 | return AVERROR(EINVAL); | 843 | return AVERROR(EINVAL); |
| 846 | } | 844 | } |