FreeBSD/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_util.c
/*
 * A safe form of realloc(), which also zeroes newly allocated space.
 */
A safe form of realloc(), which also zeroes newly allocated space.
A safe form of realloc () which also zeroes newly allocated space .
void *
zfs_realloc(libzfs_handle_t *hdl, void *ptr, size_t oldsize, size_t newsize)
{
	void *ret;
	if ((ret = realloc(ptr, newsize)) == NULL) {
		(void) no_memory(hdl);
		return (NULL);
	}
	bzero((char *)ret + oldsize, (newsize - oldsize));
	return (ret);
}
void * zfs_realloc ( libzfs_handle_t * hdl , void * ptr , size_t oldsize , size_t newsize ) { void * ret ; if ( ( ret = realloc ( ptr , newsize ) ) == NULL ) { ( void ) no_memory ( hdl ) ; return ( NULL ) ; } bzero ( ( char * ) ret + oldsize , ( newsize - oldsize ) ) ; return ( ret ) ; }
A safe form of realloc(), which also zeroes newly allocated space.
A safe form of realloc () which also zeroes newly allocated space .