tests: Make sure unused malloc() doesn't get optimized away

This commit is contained in:
Kristian Høgsberg 2012-04-19 12:07:20 -04:00
parent 55489883c4
commit 41570a5ed9

View file

@ -36,6 +36,8 @@ FAIL_TEST(sanity_malloc_direct)
void *p;
p = malloc(10); /* memory leak */
assert(p); /* assert that we got memory, also prevents
* the malloc from getting optimized away. */
free(NULL); /* NULL must not be counted */
}