mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-12 06:00:48 +00:00
SWORD25: Fix memory leak
svn-id: r53326
This commit is contained in:
parent
3fc518cd0c
commit
5d7922d052
@ -147,7 +147,13 @@ byte *ScummVMPackageManager::GetFile(const Common::String &fileName, uint *fileS
|
||||
|
||||
// Read the file
|
||||
byte *buffer = new byte[in->size()];
|
||||
if (!in->read(buffer, in->size())) return 0;
|
||||
int bytesRead = in->read(buffer, in->size());
|
||||
delete in;
|
||||
|
||||
if (!bytesRead) {
|
||||
delete buffer;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return buffer;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user