[Lite] data: Fix memory leak
This commit is contained in:
parent
25b0e7d995
commit
87fc837920
@ -592,6 +592,7 @@ PyObject* InterpreterWrapper::GetTensor(int i) const {
|
||||
size_t size_of_type;
|
||||
if (GetSizeOfType(nullptr, tensor->type, &size_of_type) != kTfLiteOk) {
|
||||
PyErr_SetString(PyExc_ValueError, "Unknown tensor type.");
|
||||
free(data)
|
||||
return nullptr;
|
||||
}
|
||||
sparse_buffer_dims[0] = tensor->bytes / size_of_type;
|
||||
|
Loading…
Reference in New Issue
Block a user