diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-23 21:38:21 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-23 21:38:21 +0000 |
commit | df901a44198015c5c634ae71f86e9f0783588a19 (patch) | |
tree | 6b555b34c8f30d0dff7746970c61d9631fc8a56c /clang/test/Analysis/malloc.c | |
parent | fa31b8ef10abd5bc0ef9ed7dfb3ac77dcaaa668a (diff) | |
download | bcm5719-llvm-df901a44198015c5c634ae71f86e9f0783588a19.tar.gz bcm5719-llvm-df901a44198015c5c634ae71f86e9f0783588a19.zip |
[analyzer] Malloc: unique leak reports by allocation site.
When we find two leak reports with the same allocation site, report only
one of them.
Provide a helper method to BugReporter to facilitate this.
llvm-svn: 151287
Diffstat (limited to 'clang/test/Analysis/malloc.c')
-rw-r--r-- | clang/test/Analysis/malloc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c index 4e42657c197..f9e3663494b 100644 --- a/clang/test/Analysis/malloc.c +++ b/clang/test/Analysis/malloc.c @@ -379,7 +379,7 @@ void mallocEscapeMalloc() { void mallocMalloc() { int *p = malloc(12); - p = malloc(12); // expected-warning{{Memory is never released; potential memory leak}} + p = malloc(12); // expected-warning 2 {{Memory is never released; potential memory leak}} } void mallocFreeMalloc() { @@ -666,7 +666,7 @@ int testStrndup(const char *s, unsigned validIndex, unsigned size) { char *s2 = strndup(s, size); s2 [validIndex + 1] = 'b'; if (s2[validIndex] != 'a') - return 0;// expected-warning {{Memory is never released; potential memory leak}} + return 0; else return 1;// expected-warning {{Memory is never released; potential memory leak}} } |