From a7d2cd38cf720f3c655e24883ca57d1ed2eec616 Mon Sep 17 00:00:00 2001 From: jianghui58 Date: Mon, 21 Nov 2022 10:12:48 +0800 Subject: [PATCH] fix mem leak --- mindspore/lite/src/common/file_utils.cc | 1 + 1 file changed, 1 insertion(+) 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);