From 4d72214fd582d78c2363c1bf67abfb466fa9ad39 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 29 Apr 2018 19:09:51 +0200 Subject: [PATCH] - fixed a memory leak in the FileReader. --- src/files.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/files.cpp b/src/files.cpp index 1e7f83bd6..fee5123ff 100644 --- a/src/files.cpp +++ b/src/files.cpp @@ -348,7 +348,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;