// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
#include <stdlib.h>

void f1() {
  int *p = malloc(10);
  return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
}

void f2() {
  int *p = malloc(10);
  free(p);
  free(p); // expected-warning{{Try to free a memory block that has been released}}
}

// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
#include <stdlib.h>

void f1() {
  int *p = malloc(10);
  return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
}

// THIS TEST CURRENTLY FAILS.
void f1_b() {
  int *p = malloc(10);
}

void f2() {
  int *p = malloc(10);
  free(p);
  free(p); // expected-warning{{Try to free a memory block that has been released}}
}

Add test case that shows a leak we don't catch.
Add test case that shows a leak we don't catch.


git-svn-id: ffe668792ed300d6c2daa1f6eba2e0aa28d7ec6c@88683 91177308-0d34-0410-b5e6-96231b3b80d8
