diff options
Diffstat (limited to 'clang/test/Analysis/malloc.c')
-rw-r--r-- | clang/test/Analysis/malloc.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/Analysis/malloc.c b/clang/test/Analysis/malloc.c index 51e2cd60432..d5bc6571e42 100644 --- a/clang/test/Analysis/malloc.c +++ b/clang/test/Analysis/malloc.c @@ -1763,6 +1763,17 @@ void testConstEscapeThroughAnotherField() { constEscape(&(s.x)); // could free s->p! } // no-warning +// PR15623 +int testNoCheckerDataPropogationFromLogicalOpOperandToOpResult(void) { + char *param = malloc(10); + char *value = malloc(10); + int ok = (param && value); + free(param); + free(value); + // Previously we ended up with 'Use of memory after it is freed' on return. + return ok; // no warning +} + // ---------------------------------------------------------------------------- // False negatives. |