!45774 [MS][LITE] fix mem leak

Merge pull request !45774 from jianghui58/codex_fuzz_master
This commit is contained in:
i-robot 2022-11-21 08:37:20 +00:00 committed by Gitee
commit 3f5b9c2eec
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
1 changed files with 1 additions and 0 deletions

View File

@ -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<size_t>(goffset);