diff options
| author | Shauren <shauren.trinity@gmail.com> | 2018-04-07 22:20:30 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2018-04-07 22:20:30 +0200 |
| commit | a71d4b70ff8329878967652b131ce811ad699aa6 (patch) | |
| tree | f32141cd02e89e7c4512b1849f578f076e967143 /src | |
| parent | 2c64bb97e6fddcbd15ef39fde3d0828bbf600ec6 (diff) | |
Add missing fclose
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/Collision/Maps/TileAssembler.cpp | 3 | ||||
| -rw-r--r-- | src/common/Collision/Models/GameObjectModel.cpp | 1 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/common/Collision/Maps/TileAssembler.cpp b/src/common/Collision/Maps/TileAssembler.cpp index c57d19baf32..e9203ca7378 100644 --- a/src/common/Collision/Maps/TileAssembler.cpp +++ b/src/common/Collision/Maps/TileAssembler.cpp @@ -355,7 +355,10 @@ namespace VMAP char ident[8]; if (fread(ident, 1, 8, model_list) != 8 || memcmp(ident, VMAP::RAW_VMAP_MAGIC, 8) != 0) + { + fclose(model_list); return; + } FILE* model_list_copy = fopen((iDestDir + "/" + GAMEOBJECT_MODELS).c_str(), "wb"); if (!model_list_copy) diff --git a/src/common/Collision/Models/GameObjectModel.cpp b/src/common/Collision/Models/GameObjectModel.cpp index 846b98ef837..22de17e1ad0 100644 --- a/src/common/Collision/Models/GameObjectModel.cpp +++ b/src/common/Collision/Models/GameObjectModel.cpp @@ -58,6 +58,7 @@ void LoadGameObjectModelList(std::string const& dataPath) || memcmp(magic, VMAP::VMAP_MAGIC, 8) != 0) { TC_LOG_ERROR("misc", "File '%s' has wrong header, expected %s.", VMAP::GAMEOBJECT_MODELS, VMAP::VMAP_MAGIC); + fclose(model_list_file); return; } |
