diff options
Diffstat (limited to 'test/Analysis/malloc-interprocedural.c')
-rw-r--r-- | test/Analysis/malloc-interprocedural.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/Analysis/malloc-interprocedural.c b/test/Analysis/malloc-interprocedural.c index e67c14be42..374c4a310d 100644 --- a/test/Analysis/malloc-interprocedural.c +++ b/test/Analysis/malloc-interprocedural.c @@ -38,8 +38,10 @@ static void test11() { my_free1(data); } -static void test2() { - void * data = my_malloc2(1, 4); +static void testUniqueingByallocationSiteInTopLevelFunction() { + void *data = my_malloc2(1, 4); + data = 0; + int x = 5;// expected-warning {{Memory is never released; potential memory leak}} data = my_malloc2(1, 4);// expected-warning {{Memory is never released; potential memory leak}} } @@ -94,4 +96,3 @@ int uafAndCallsFooWithEmptyReturn() { fooWithEmptyReturn(12); return *x; // expected-warning {{Use of memory after it is freed}} } - |