SAGA2: Plug memory leak. CID 1458006

This commit is contained in:
Eugene Sandulenko 2021-07-12 00:42:40 +02:00
parent f7aa3933b6
commit 3c7e2ef033
No known key found for this signature in database
GPG Key ID: 014D387312D34F08
2 changed files with 8 additions and 0 deletions

View File

@ -645,6 +645,13 @@ ColorSchemeList::ColorSchemeList(int count, Common::SeekableReadStream *stream)
_schemes[i] = new ColorScheme(stream);
}
ColorSchemeList::~ColorSchemeList() {
for (int i = 0; i < _count; ++i)
delete _schemes[i];
free(_schemes);
}
ActorAppearance *LoadActorAppearance(uint32 id, int16 banksNeeded) {
int16 bank;
int schemeListSize;

View File

@ -186,6 +186,7 @@ public:
ColorScheme **_schemes;
ColorSchemeList(int count, Common::SeekableReadStream *stream);
~ColorSchemeList();
};
/* ===================================================================== *