summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Pragma.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-05-02 21:44:48 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-05-02 21:44:48 +0000
commit4d9c3df429c2d26f30c0312cad6a2637ac5f179b (patch)
treed6477c53b78436d255727f643722989a645fd52e /clang/lib/Lex/Pragma.cpp
parent6dd9f8feb336b06b3d9077b17d88e899f1c622a9 (diff)
downloadbcm5719-llvm-4d9c3df429c2d26f30c0312cad6a2637ac5f179b.tar.gz
bcm5719-llvm-4d9c3df429c2d26f30c0312cad6a2637ac5f179b.zip
[leaks] Fix a leak recently introduced to the pragma handling. This
whole code would be better with std::unique_ptr managing the lifetimes of the handlers, but I wanted to make a targeted fix to the leaks first. With this change, all of the Clang preprocessor tests are leak free with LSan. llvm-svn: 207872
Diffstat (limited to 'clang/lib/Lex/Pragma.cpp')
-rw-r--r--clang/lib/Lex/Pragma.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/clang/lib/Lex/Pragma.cpp b/clang/lib/Lex/Pragma.cpp
index 97a08da8ef3..3e8a40312b4 100644
--- a/clang/lib/Lex/Pragma.cpp
+++ b/clang/lib/Lex/Pragma.cpp
@@ -1403,6 +1403,7 @@ void Preprocessor::IgnorePragmas() {
"Invalid namespace, registered as a regular pragma handler!");
if (PragmaHandler *Existing = STDCNamespace->FindHandler("", false)) {
RemovePragmaHandler("STDC", Existing);
+ delete Existing;
}
}
AddPragmaHandler("STDC", new EmptyPragmaHandler());
OpenPOWER on IntegriCloud