summaryrefslogtreecommitdiff
path: root/src/unittest
diff options
context:
space:
mode:
Diffstat (limited to 'src/unittest')
-rw-r--r--src/unittest/test_map_settings_manager.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/unittest/test_map_settings_manager.cpp b/src/unittest/test_map_settings_manager.cpp
index 9292bf87c..4f5ac80f2 100644
--- a/src/unittest/test_map_settings_manager.cpp
+++ b/src/unittest/test_map_settings_manager.cpp
@@ -75,8 +75,10 @@ std::string read_file_to_string(const std::string &filepath)
fseek(f, 0, SEEK_END);
long filesize = ftell(f);
- if (filesize == -1)
+ if (filesize == -1) {
+ fclose(f);
return "";
+ }
rewind(f);
buf.resize(filesize);