Fix memory leak in FileSystemStatCache.
authorManuel Klimek <klimek@google.com>
Mon, 7 Jul 2014 17:00:49 +0000 (17:00 +0000)
committerManuel Klimek <klimek@google.com>
Mon, 7 Jul 2014 17:00:49 +0000 (17:00 +0000)
Patch by Guochun Shi.

llvm-svn: 212466

clang/lib/Basic/FileSystemStatCache.cpp

index 61f745d..4952ef4 100644 (file)
@@ -111,6 +111,7 @@ bool FileSystemStatCache::get(const char *Path, FileData &Data, bool isFile,
     // If not, close the file if opened.
     if (F && *F) {
       (*F)->close();
+      delete *F;
       *F = nullptr;
     }