blob: b881b1b2babe7ba778bec88f10357225f5120bd3 [file] [log] [blame]
Ted Kremenek8382cf52009-11-13 18:46:29 +00001// RUN: clang-cc -analyze -analyzer-experimental-internal-checks -checker-cfref -analyzer-experimental-checks -analyzer-store=region -verify %s
Zhongxing Xufc7ac8f2009-11-13 07:48:11 +00002#include <stdlib.h>
3
4void f1() {
5 int *p = malloc(10);
6 return; // expected-warning{{Allocated memory never released. Potential memory leak.}}
7}
8
9void f2() {
10 int *p = malloc(10);
11 free(p);
12 free(p); // expected-warning{{Try to free a memory block that has been released}}
13}