diff options
Diffstat (limited to 'clang/test')
-rw-r--r-- | clang/test/Analysis/malloc.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c index a38c30a5ed6..1923305fe20 100644 --- a/clang/test/Analysis/malloc.c +++ b/clang/test/Analysis/malloc.c @@ -671,6 +671,12 @@ int testStrndup(const char *s, unsigned validIndex, unsigned size) { return 1;// expected-warning {{Memory is never released; potential memory leak}} } +void testStrdupContentIsDefined(const char *s, unsigned validIndex) { + char *s2 = strdup(s); + char result = s2[1];// no warning + free(s2); +} + // Below are the known false positives. // TODO: There should be no warning here. This one might be difficult to get rid of. |