mirror of
https://github.com/Zenithsiz/ftmemsim-valgrind.git
synced 2026-02-03 18:13:01 +00:00
other wrappers in that it took place before the silly-args check. Testcase and patch by Yann Droneaud (yann@droneaud.fr). Fixes #281482 Also included is a related fix to MC_(new_block). Incrementing the alloc counter and updating the allocated memory amount should occur under the same condition (allocation succeeded). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12324
26 lines
232 B
C
26 lines
232 B
C
/*
|
|
* test case for valgrind realloc() bug
|
|
*/
|
|
|
|
#include <stdlib.h>
|
|
#include <assert.h>
|
|
|
|
int
|
|
main(void)
|
|
{
|
|
void *p;
|
|
void *r;
|
|
|
|
p = malloc(1);
|
|
assert(p != NULL);
|
|
|
|
r = realloc(p, -1);
|
|
assert(r == NULL);
|
|
|
|
free(p);
|
|
|
|
return 0;
|
|
}
|
|
|
|
|