// RUN: %clang_analyze_cc1 -verify \
// RUN: -analyzer-checker=core \
// RUN: -analyzer-checker=alpha.deadcode.UnreachableCode \
// RUN: -analyzer-checker=alpha.core.CastSize \
// RUN: -analyzer-checker=unix.Malloc \
// RUN: -analyzer-config unix.DynamicMemoryModeling:Optimistic=true %s
typedef size_t;
void *;
void ;
;
void *myglobalpointer;
;
struct stuff myglobalstuff;
void
void // expected-warning{{Potential leak of memory pointed to by}}
void
// Test that we can pass out allocated memory via pointer-to-pointer.
void
void
// Allocating memory for a field via multiple indirections to our arguments is OK.
void
void
void
void
// No leak if malloc returns null.
void
// This case inflicts a possible double-free.
void
void *
// This case is (possibly) ok, be conservative
void *