Core/Collision: Corrected logic for closing source file in WorldModel_Raw::Read, fixes resource leak if method succeeds and prevents double free if it fails.

Closes #9823
This commit is contained in:
Shauren
2013-05-18 21:25:26 +02:00
parent d6709ed610
commit 7058d8bb4c

View File

@@ -500,7 +500,7 @@ namespace VMAP
char ident[8];
ident[7] = 0;
int readOperation = 0;
READ_OR_RETURN(&ident, 7);
CMP_OR_RETURN(ident, RAW_VMAP_MAGIC);
@@ -517,7 +517,7 @@ namespace VMAP
for (uint32 g = 0; g < groups && succeed; ++g)
succeed = groupsArray[g].Read(rf);
if (!succeed) /// rf will be freed inside Read if the function had any errors.
if (succeed) /// rf will be freed inside Read if the function had any errors.
fclose(rf);
return succeed;
}