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

Christoph Hellwig hch at infradead.org
Sun Jun 21 04:20:47 CDT 2015


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;
}



More information about the xfs mailing list