1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 12:39:11 +00:00

Fix: Protect against a few out of bounds or uninitialised usage errors

This commit is contained in:
Charles Pigott
2018-10-14 23:36:14 +01:00
committed by frosch
parent 52ed3bcbaa
commit b5028efc1f
9 changed files with 19 additions and 5 deletions

View File

@@ -371,7 +371,10 @@ static bool CompareFiles(const char *n1, const char *n2)
if (f2 == NULL) return false;
FILE *f1 = fopen(n1, "rb");
if (f1 == NULL) error("can't open %s", n1);
if (f1 == NULL) {
fclose(f2);
error("can't open %s", n1);
}
size_t l1, l2;
do {