diff options
author | Anna Zaks <ganna@apple.com> | 2012-02-11 21:44:39 +0000 |
---|---|---|
committer | Anna Zaks <ganna@apple.com> | 2012-02-11 21:44:39 +0000 |
commit | 3aa5225d5ee00eb7847cb830e6c936e8dc08ee6a (patch) | |
tree | bdc68ab6218c80732778e8f4927786dd761ba82e /clang/test/Analysis/malloc-annotations.c | |
parent | d3571e5ad3cc43dd2f2d968c9bdddaa393887b63 (diff) | |
download | bcm5719-llvm-3aa5225d5ee00eb7847cb830e6c936e8dc08ee6a.tar.gz bcm5719-llvm-3aa5225d5ee00eb7847cb830e6c936e8dc08ee6a.zip |
[analyzer] Malloc Checker: Report a leak when we are returning freed
memory.
(As per one test case, the existing checker thought that this could
cause a lot of false positives - not sure if that's valid, to be
verified.)
llvm-svn: 150313
Diffstat (limited to 'clang/test/Analysis/malloc-annotations.c')
-rw-r--r-- | clang/test/Analysis/malloc-annotations.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/clang/test/Analysis/malloc-annotations.c b/clang/test/Analysis/malloc-annotations.c index 7890cfc1764..98dc2e7269b 100644 --- a/clang/test/Analysis/malloc-annotations.c +++ b/clang/test/Analysis/malloc-annotations.c @@ -128,12 +128,10 @@ void af3() { free(p); // no-warning } -// This case would inflict a double-free elsewhere. -// However, this case is considered an analyzer bug since it causes false-positives. int * af4() { int *p = my_malloc(12); my_free(p); - return p; // no-warning + return p; // expected-warning{{Use of dynamically allocated}} } // This case is (possibly) ok, be conservative |