leak_detective: Assign return value of realloc to buf
If realloc return a pointer value different from the value to be reallocated, a double free can occur in this context. Signed-off-by: Thomas Egerer <[email protected]>
This commit is contained in:
committed by
Martin Willi
parent
7707357227
commit
b351acfed6
@@ -483,7 +483,7 @@ static void* real_realloc(void *ptr, size_t size)
|
|||||||
static bool register_hooks()
|
static bool register_hooks()
|
||||||
{
|
{
|
||||||
void *buf = real_malloc(8);
|
void *buf = real_malloc(8);
|
||||||
real_realloc(buf, 16);
|
buf = real_realloc(buf, 16);
|
||||||
real_free(buf);
|
real_free(buf);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user