aboutsummaryrefslogtreecommitdiff
path: root/test/Analysis/malloc-annotations.c
diff options
context:
space:
mode:
authorAnna Zaks <ganna@apple.com>2012-06-20 20:57:46 +0000
committerAnna Zaks <ganna@apple.com>2012-06-20 20:57:46 +0000
commit050cdd7107526df8ff7a8e0a08b3e99c83c263c0 (patch)
tree23dbc134505ffa121467669a2de06cec4679205d /test/Analysis/malloc-annotations.c
parent2df3a7a58b37d87ebf9e5e9251d56d1f8506f8b6 (diff)
[analyzer] Malloc: cleanup, disallow free on relinquished memory.
This commits sets the grounds for more aggressive use after free checking. We will use the Relinquished sate to denote that someone else is now responsible for releasing the memory. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158850 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Analysis/malloc-annotations.c')
-rw-r--r--test/Analysis/malloc-annotations.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/Analysis/malloc-annotations.c b/test/Analysis/malloc-annotations.c
index a0c145279d..15ce62d9a5 100644
--- a/test/Analysis/malloc-annotations.c
+++ b/test/Analysis/malloc-annotations.c
@@ -123,12 +123,12 @@ void af2e() {
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.
+// This case inflicts a possible double-free.
+// TODO: Better error message.
void af3() {
int *p = my_malloc(12);
my_hold(p);
- free(p); // no-warning
+ free(p); // expected-warning{{Attempt to free released memory}}
}
int * af4() {