diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-07-05 14:23:59 +0000 |
commit | c192b3dcffd5e672a2b2e1730e2440febb4fb192 (patch) | |
tree | ac719b5984165053bf83d71142e4d96b609b9784 /lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp | |
parent | 2e645aa5697838f16ec570eb07c2bee7e13d0e0b (diff) |
Notes
Diffstat (limited to 'lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp')
-rw-r--r-- | lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp index 4bfed8504f98..a799b4c21982 100644 --- a/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp +++ b/lib/StaticAnalyzer/Checkers/UnixAPIChecker.cpp @@ -83,9 +83,9 @@ void UnixAPIChecker::ReportOpenBug(CheckerContext &C, LazyInitialize(BT_open, "Improper use of 'open'"); - BugReport *Report = new BugReport(*BT_open, Msg, N); + auto Report = llvm::make_unique<BugReport>(*BT_open, Msg, N); Report->addRange(SR); - C.emitReport(Report); + C.emitReport(std::move(Report)); } void UnixAPIChecker::CheckOpen(CheckerContext &C, const CallExpr *CE) const { @@ -200,9 +200,9 @@ void UnixAPIChecker::CheckPthreadOnce(CheckerContext &C, LazyInitialize(BT_pthreadOnce, "Improper use of 'pthread_once'"); - BugReport *report = new BugReport(*BT_pthreadOnce, os.str(), N); + auto report = llvm::make_unique<BugReport>(*BT_pthreadOnce, os.str(), N); report->addRange(CE->getArg(0)->getSourceRange()); - C.emitReport(report); + C.emitReport(std::move(report)); } //===----------------------------------------------------------------------===// @@ -241,11 +241,11 @@ bool UnixAPIChecker::ReportZeroByteAllocation(CheckerContext &C, SmallString<256> S; llvm::raw_svector_ostream os(S); os << "Call to '" << fn_name << "' has an allocation size of 0 bytes"; - BugReport *report = new BugReport(*BT_mallocZero, os.str(), N); + auto report = llvm::make_unique<BugReport>(*BT_mallocZero, os.str(), N); report->addRange(arg->getSourceRange()); bugreporter::trackNullOrUndefValue(N, arg, *report); - C.emitReport(report); + C.emitReport(std::move(report)); return true; } |