mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
fixed resource leak in OpenDecompressor
This commit is contained in:
parent
205d4b5ff3
commit
ef4c4ee503
2 changed files with 2 additions and 0 deletions
|
@ -35,6 +35,7 @@
|
||||||
|
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <cstdint>
|
||||||
#include "w_zip.h"
|
#include "w_zip.h"
|
||||||
#include "ancientzip.h"
|
#include "ancientzip.h"
|
||||||
#include "resourcefile.h"
|
#include "resourcefile.h"
|
||||||
|
|
|
@ -985,6 +985,7 @@ bool OpenDecompressor(FileReader& self, FileReader &parent, FileReader::Size len
|
||||||
// read everything into a MemoryArrayReader.
|
// read everything into a MemoryArrayReader.
|
||||||
FileData data(nullptr, length);
|
FileData data(nullptr, length);
|
||||||
fr->Read(data.writable(), length);
|
fr->Read(data.writable(), length);
|
||||||
|
delete fr;
|
||||||
fr = new MemoryArrayReader(data);
|
fr = new MemoryArrayReader(data);
|
||||||
}
|
}
|
||||||
else if ((flags & DCF_SEEKABLE))
|
else if ((flags & DCF_SEEKABLE))
|
||||||
|
|
Loading…
Reference in a new issue