[analyzer] Malloc: remove assert since is not valid as of r161248

We can be in the situation where we did not track the symbol before
realloc was called on it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161294 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
index 0a36071..4f19c2e 100644
--- a/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
+++ b/lib/StaticAnalyzer/Checkers/MallocChecker.cpp
@@ -1569,11 +1569,6 @@
 
     // Is this is the first appearance of the reallocated symbol?
     if (!statePrev->get<RegionState>(FailedReallocSymbol)) {
-      // If we ever hit this assert, that means BugReporter has decided to skip
-      // node pairs or visit them out of order.
-      assert(state->get<RegionState>(FailedReallocSymbol) &&
-        "Missed the reallocation point");
-
       // We're at the reallocation point.
       Msg = "Attempt to reallocate memory";
       StackHint = new StackHintGeneratorForSymbol(Sym,
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c
index 9644246..7f5062a 100644
--- a/test/Analysis/malloc.c
+++ b/test/Analysis/malloc.c
@@ -1007,3 +1007,15 @@
   }
   free(p); // expected-warning {{Attempt to free released memory}}
 }
+
+struct HasPtr {
+  int *p;
+};
+
+int* reallocButNoMalloc(struct HasPtr *a, int c, int size) {
+  int *s;
+  a->p = (int *)realloc(a->p, size);
+  if (a->p == 0)
+    return 0; // expected-warning{{Memory is never released; potential leak}}
+  return a->p;
+}