summaryrefslogtreecommitdiffstats
path: root/clang/lib/Checker
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Checker')
-rw-r--r--clang/lib/Checker/BugReporter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/Checker/BugReporter.cpp b/clang/lib/Checker/BugReporter.cpp
index d4b150294e6..7272b348581 100644
--- a/clang/lib/Checker/BugReporter.cpp
+++ b/clang/lib/Checker/BugReporter.cpp
@@ -44,8 +44,10 @@ void BugReporterContext::addVisitor(BugReporterVisitor* visitor) {
visitor->Profile(ID);
void *InsertPos;
- if (CallbacksSet.FindNodeOrInsertPos(ID, InsertPos))
+ if (CallbacksSet.FindNodeOrInsertPos(ID, InsertPos)) {
+ delete visitor;
return;
+ }
CallbacksSet.InsertNode(visitor, InsertPos);
Callbacks = F.Add(visitor, Callbacks);
OpenPOWER on IntegriCloud