Home | History | Annotate | Download | only in tests
      1 /*
      2  * test case for valgrind realloc() bug
      3  */
      4 
      5 #include <stdlib.h>
      6 #include <assert.h>
      7 
      8 int
      9 main(void)
     10 {
     11 	void *p;
     12 	void *r;
     13 
     14 	p = malloc(1);
     15 	assert(p != NULL);
     16 
     17 	r = realloc(p, -1);
     18 	assert(r == NULL);
     19 
     20 	free(p);
     21 
     22 	return 0;
     23 }
     24 
     25 
     26