Re: [PATCH v2 2/3] xfs_repair: clear new memory after realloc

Christoph Hellwig
2015-06-21T09:20:52Z

Can you add a new realloc_zeroed helper?, e.g.

void *
realloc_zeroed(void *ptr, size_t old_size, size_t new_size)
{
ptr = realloc(ptr, new_size);
if (ptr)
memset(ptr + old_size, 0, new_size - old_size);
return ptr;