aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2014-08-29 18:18:43 +0000
committerDavid Blaikie <dblaikie@gmail.com>2014-08-29 18:18:43 +0000
commitd15481ccea21bae481a496a7acbde4532abc890c (patch)
tree137b20cf507c6f692417052c0e3658f754b71d38 /clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
parentf6ee7a7cddaafd3d14d522a6207eff010ad5257b (diff)
downloadllvm-d15481ccea21bae481a496a7acbde4532abc890c.zip
llvm-d15481ccea21bae481a496a7acbde4532abc890c.tar.gz
llvm-d15481ccea21bae481a496a7acbde4532abc890c.tar.bz2
unique_ptr-ify PathDiagnosticPiece ownership
llvm-svn: 216751
Diffstat (limited to 'clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp')
-rw-r--r--clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index c7a64fb..bb1edea 100644
--- a/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/clang/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -420,9 +420,9 @@ private:
BugReporterContext &BRC,
BugReport &BR) override;
- PathDiagnosticPiece* getEndPath(BugReporterContext &BRC,
- const ExplodedNode *EndPathNode,
- BugReport &BR) override {
+ std::unique_ptr<PathDiagnosticPiece>
+ getEndPath(BugReporterContext &BRC, const ExplodedNode *EndPathNode,
+ BugReport &BR) override {
if (!IsLeak)
return nullptr;
@@ -430,7 +430,8 @@ private:
PathDiagnosticLocation::createEndOfPath(EndPathNode,
BRC.getSourceManager());
// Do not add the statement itself as a range in case of leak.
- return new PathDiagnosticEventPiece(L, BR.getDescription(), false);
+ return llvm::make_unique<PathDiagnosticEventPiece>(L, BR.getDescription(),
+ false);
}
private: