From eae2a0eb8ff2ba3d6f16824f1afe7fec203cd5de Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Sat, 7 Feb 2009 22:54:59 +0000 Subject: [PATCH] Fix null dereference. llvm-svn: 64044 --- clang/lib/Analysis/CFRefCount.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/clang/lib/Analysis/CFRefCount.cpp b/clang/lib/Analysis/CFRefCount.cpp index 8b3f37f1e536..662b2f5f97b4 100644 --- a/clang/lib/Analysis/CFRefCount.cpp +++ b/clang/lib/Analysis/CFRefCount.cpp @@ -2544,8 +2544,11 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug& D, ExplodedNode *n, llvm::raw_string_ostream os(Description); SourceManager& SMgr = Eng.getContext().getSourceManager(); unsigned AllocLine = SMgr.getInstantiationLineNumber(AllocSite); - os << "Potential leak of object allocated on line " << AllocLine - << " and store into '" << AllocBinding->getString() << '\''; + os << "Potential leak of object allocated on line " << AllocLine; + + // FIXME: AllocBinding doesn't get populated for RegionStore yet. + if (AllocBinding) + os << " and store into '" << AllocBinding->getString() << '\''; } //===----------------------------------------------------------------------===//