diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-06 00:22:09 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-01-06 00:22:09 +0000 |
commit | ce52bb3dec520ef94574280ac3ef8ad63f4f1ce2 (patch) | |
tree | b26695bf2883d5b9561d162cef5c9ef15fc35ef9 /lib/Lex/Pragma.cpp | |
parent | 5930a4c5224eea3b0558655f7f8c9ea027ef573e (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.cpp | 4 |
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) { |