mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 16:45:20 +02:00
couple of memory leaks fixes.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user