summaryrefslogtreecommitdiffstats
path: root/lib/Basic/FileSystemStatCache.cpp
diff options
context:
space:
mode:
authorManuel Klimek <klimek@google.com>2014-07-07 17:00:49 +0000
committerManuel Klimek <klimek@google.com>2014-07-07 17:00:49 +0000
commitdab00ab1953d968b24e9797dc82e632d821aaf1c (patch)
tree4f96944b4cf10f8dffd93674883c575131acc50a /lib/Basic/FileSystemStatCache.cpp
parentd31b4b9745e6aca7dc1fdfae52dbc125f5ca3679 (diff)
Fix memory leak in FileSystemStatCache.
Patch by Guochun Shi. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212466 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/FileSystemStatCache.cpp')
-rw-r--r--lib/Basic/FileSystemStatCache.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/Basic/FileSystemStatCache.cpp b/lib/Basic/FileSystemStatCache.cpp
index 61f745d8bb..4952ef49ef 100644
--- a/lib/Basic/FileSystemStatCache.cpp
+++ b/lib/Basic/FileSystemStatCache.cpp
@@ -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;
}