diff --git a/tensorflow/lite/kernels/fill.cc b/tensorflow/lite/kernels/fill.cc index 079ee44f371..afd0c326ccc 100644 --- a/tensorflow/lite/kernels/fill.cc +++ b/tensorflow/lite/kernels/fill.cc @@ -38,6 +38,7 @@ TfLiteStatus ResizeOutputImpl(TfLiteContext* context, const TfLiteTensor* dims, for (int i = 0; i < output_shape->size; ++i) { T data = GetTensorData(dims)[i]; if (data < 0) { + TfLiteIntArrayFree(output_shape); context->ReportError(context, "Fill dimensions must be >= 0", dims->type); return kTfLiteError; }