mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-03 07:15:42 -04:00
tests: Make sure unused malloc() doesn't get optimized away
This commit is contained in:
parent
55489883c4
commit
41570a5ed9
1 changed files with 2 additions and 0 deletions
|
|
@ -36,6 +36,8 @@ FAIL_TEST(sanity_malloc_direct)
|
||||||
void *p;
|
void *p;
|
||||||
|
|
||||||
p = malloc(10); /* memory leak */
|
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 */
|
free(NULL); /* NULL must not be counted */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue