diff --git a/mindspore/lite/src/common/file_utils.cc b/mindspore/lite/src/common/file_utils.cc index 4256ced4b9a..7a327fbd00b 100644 --- a/mindspore/lite/src/common/file_utils.cc +++ b/mindspore/lite/src/common/file_utils.cc @@ -181,6 +181,7 @@ char *ReadFile(const char *file, size_t *size) { if (goffset < 0) { MS_LOG(ERROR) << "read file range failed"; ifs->close(); + delete ifs; return nullptr; } *size = static_cast(goffset);