Fix null dereference.

llvm-svn: 64044
This commit is contained in:
Ted Kremenek 2009-02-07 22:54:59 +00:00
parent 15cb75a20c
commit eae2a0eb8f
1 changed files with 5 additions and 2 deletions

View File

@ -2544,8 +2544,11 @@ CFRefLeakReport::CFRefLeakReport(CFRefBug& D, ExplodedNode<GRState> *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() << '\'';
}
//===----------------------------------------------------------------------===//