mirror of https://github.com/axmolengine/axmol.git
Merge pull request #16127 from mogemimi/add-missing-fclose
Add missing fclose() to fix a possible bug caused by PR #16114
This commit is contained in:
commit
1544b8eed0
|
@ -647,6 +647,7 @@ FileUtils::Status FileUtils::getContents(const std::string& filename, ResizableB
|
||||||
#endif
|
#endif
|
||||||
struct stat statBuf;
|
struct stat statBuf;
|
||||||
if (fstat(descriptor, &statBuf) == -1) {
|
if (fstat(descriptor, &statBuf) == -1) {
|
||||||
|
fclose(fp);
|
||||||
return Status::ReadFailed;
|
return Status::ReadFailed;
|
||||||
}
|
}
|
||||||
size_t size = statBuf.st_size;
|
size_t size = statBuf.st_size;
|
||||||
|
|
Loading…
Reference in New Issue