diff options
Diffstat (limited to 'clang/test/Analysis/malloc-interprocedural.c')
-rw-r--r-- | clang/test/Analysis/malloc-interprocedural.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc-interprocedural.c b/clang/test/Analysis/malloc-interprocedural.c index 0cdd9fb2810..e67c14be426 100644 --- a/clang/test/Analysis/malloc-interprocedural.c +++ b/clang/test/Analysis/malloc-interprocedural.c @@ -70,6 +70,16 @@ void test5() { my_free1((int*)data); } +static char *reshape(char *in) { + return 0; +} + +void testThatRemoveDeadBindingsRunBeforeEachCall() { + char *v = malloc(12); + v = reshape(v); + v = reshape(v);// expected-warning {{Memory is never released; potential memory leak}} +} + // Test that we keep processing after 'return;' void fooWithEmptyReturn(int x) { if (x) |