summaryrefslogtreecommitdiffstats
path: root/clang/test/Analysis/malloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Analysis/malloc.c')
-rw-r--r--clang/test/Analysis/malloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c
index 662df4c28b7..3a7247c473b 100644
--- a/clang/test/Analysis/malloc.c
+++ b/clang/test/Analysis/malloc.c
@@ -1386,7 +1386,9 @@ char* reallocButNoMalloc(struct HasPtr *a, int c, int size) {
int *s;
char *b = realloc(a->p, size);
char *m = realloc(a->p, size); // expected-warning {{Attempt to free released memory}}
- return a->p;
+ // We don't expect a use-after-free for a->P here because the warning above
+ // is a sink.
+ return a->p; // no-warning
}
// We should not warn in this case since the caller will presumably free a->p in all cases.
OpenPOWER on IntegriCloud