diff options
Diffstat (limited to 'test/Analysis/malloc.c')
-rw-r--r-- | test/Analysis/malloc.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/Analysis/malloc.c b/test/Analysis/malloc.c index 190a2548d7..7ffc9a1ec0 100644 --- a/test/Analysis/malloc.c +++ b/test/Analysis/malloc.c @@ -240,6 +240,14 @@ void mallocFreeUse_params() { myfooint(*p); //expected-warning{{Use dynamically allocated memory after it is freed}} } +void mallocFailedOrNot() { + int *p = malloc(12); + if (!p) + free(p); + else + free(p); +} + int *Gl; struct GlStTy { int *x; |