- fixed a memory leak in the FileReader.

(cherry picked from commit 4d72214fd5)
This commit is contained in:
Christoph Oelckers 2018-04-29 19:09:51 +02:00 committed by drfrag666
parent 56b0e9627c
commit 9415b86e37

View file

@ -350,7 +350,11 @@ public:
bool FileReader::OpenFile(const char *filename, FileReader::Size start, FileReader::Size length)
{
auto reader = new StdFileReader;
if (!reader->Open(filename, (long)start, (long)length)) return false;
if (!reader->Open(filename, (long)start, (long)length))
{
delete reader;
return false;
}
Close();
mReader = reader;
return true;