From: Manuel Klimek Date: Mon, 7 Jul 2014 17:00:49 +0000 (+0000) Subject: Fix memory leak in FileSystemStatCache. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dab00ab1953d968b24e9797dc82e632d821aaf1c;p=clang 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 --- 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; }