]> granicus.if.org Git - clang/commitdiff
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212466 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/FileSystemStatCache.cpp

index 61f745d8bba9790d6afcba962e84b7c12477bb88..4952ef49ef8a52b5016141e385b57f45027d939b 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;
     }