aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-06 00:22:09 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-06 00:22:09 +0000
commitce52bb3dec520ef94574280ac3ef8ad63f4f1ce2 (patch)
treeb26695bf2883d5b9561d162cef5c9ef15fc35ef9 /lib/Lex/Pragma.cpp
parent5930a4c5224eea3b0558655f7f8c9ea027ef573e (diff)
Fix a memory leak of PragmaNamespaces, rdar://10611796.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147635 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/Pragma.cpp')
-rw-r--r--lib/Lex/Pragma.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Lex/Pragma.cpp b/lib/Lex/Pragma.cpp
index cc612fff9f..1ccfe8c2c9 100644
--- a/lib/Lex/Pragma.cpp
+++ b/lib/Lex/Pragma.cpp
@@ -714,8 +714,10 @@ void Preprocessor::RemovePragmaHandler(StringRef Namespace,
// If this is a non-default namespace and it is now empty, remove
// it.
- if (NS != PragmaHandlers && NS->IsEmpty())
+ if (NS != PragmaHandlers && NS->IsEmpty()) {
PragmaHandlers->RemovePragmaHandler(NS);
+ delete NS;
+ }
}
bool Preprocessor::LexOnOffSwitch(tok::OnOffSwitch &Result) {