tests/vg_regtest: Always evaluate prerequisite expressions with sh
[valgrind.git] / memcheck / tests / badfree.c
blobf9393c7753b5444f59ed8255e38dacfa74a9f8f8
3 #include <stdio.h>
4 #include <stdlib.h>
5 static void* return_arg(void* q);
6 int main ( void )
8 void* p = (void*)0x87654321;
9 int q[] = { 1, 2, 3 };
11 /* Free a pointer to Never-Never Land */
12 free(p);
14 /* Free a pointer to a stack block */
15 free(return_arg(q));
17 return 0;
21 * The only purpose of the function below is to make sure that gcc 4.4.x does
22 * not print the following warning during the compilation of this test program:
23 * warning: attempt to free a non-heap object
25 static void* return_arg(void* q)
27 return q;