]> granicus.if.org Git - clang/commitdiff
Fix null dereference.
authorTed Kremenek <kremenek@apple.com>
Sat, 7 Feb 2009 22:54:59 +0000 (22:54 +0000)
committerTed Kremenek <kremenek@apple.com>
Sat, 7 Feb 2009 22:54:59 +0000 (22:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64044 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/CFRefCount.cpp

index 8b3f37f1e53604a152c1d01e99db94011b83641a..662b2f5f97b4738670c6e68b5f4396c7523375fe 100644 (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() << '\'';
 }
 
 //===----------------------------------------------------------------------===//