mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-15 19:13:07 +01:00
Fix possible memory leak in CreateObjectFromJson
As reported by PVS-Studio. Warning: V773. Fix 1/7. Issue: 12523
This commit is contained in:
@@ -472,6 +472,7 @@ namespace ObjectFactory
|
||||
result->ReadJson(&readContext, jRoot);
|
||||
if (readContext.WasError())
|
||||
{
|
||||
delete result;
|
||||
throw std::runtime_error("Object has errors");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user