mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-31 06:07:37 +01:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user