summaryrefslogtreecommitdiffstats
path: root/clang
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
commit7ce752610f4d74c20f768911b9d545719ac95554 (patch)
tree5ea7d46687612659c05f79a9950527a29972d12f /clang
parentae920b69f58b20e72dfcc72b77ec305462a1ac13 (diff)
downloadbcm5719-llvm-7ce752610f4d74c20f768911b9d545719ac95554.tar.gz
bcm5719-llvm-7ce752610f4d74c20f768911b9d545719ac95554.zip
Fix a memory leak of PragmaNamespaces, rdar://10611796.
llvm-svn: 147635
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Lex/Pragma.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index cc612fff9ff..1ccfe8c2c9b 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/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) {
OpenPOWER on IntegriCloud