rem: zhp->zpool_config = *newconfig;
add: verify(nvlist_lookup_uint64(zhp->zpool_config, ZPOOL_CONFIG_POOL_TXG, &oldtxg) == 0); verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG, &newtxg) == 0);  if (zhp->zpool_old_config != NULL) nvlist_free(zhp->zpool_old_config);  if (oldtxg != newtxg) { nvlist_free(zhp->zpool_config); zhp->zpool_old_config = NULL; } else { zhp->zpool_old_config = zhp->zpool_config; } }  zhp->zpool_config = config;
context: zpool_refresh_stats(zpool_handle_t *zhp, nvlist_t **oldconfig,    nvlist_t **newconfig){	zfs_cmd_t zc = { 0 };	int error;	(void) strcpy(zc.zc_name, zhp->zpool_name);	if (zhp->zpool_config_size == 0)		zhp->zpool_config_size = 1 << 16;	zc.zc_config_dst_size = zhp->zpool_config_size;	zc.zc_config_dst = (uint64_t)(uintptr_t)	    zfs_malloc(zc.zc_config_dst_size);	while ((error = ioctl(zfs_fd, ZFS_IOC_POOL_STATS, &zc)) != 0) {		error = errno;		if (error == ENXIO) {			/*			 * We can't open one or more top-level vdevs,			 * but we have the config.			 */			break;		}		free((void *)(uintptr_t)zc.zc_config_dst);		if (error == ENOENT || error == EINVAL) {			/*			 * There's no such pool (ENOENT)			 * or the config is bogus (EINVAL).			 */			return (error);		}		if (error != ENOMEM)			zfs_baderror(error);		zc.zc_config_dst =		    (uint64_t)(uintptr_t)zfs_malloc(zc.zc_config_dst_size);	}	verify(nvlist_unpack((void *)(uintptr_t)zc.zc_config_dst,	    zc.zc_config_dst_size, newconfig, 0) == 0);	zhp->zpool_config_size = zc.zc_config_dst_size;	free((void *)(uintptr_t)zc.zc_config_dst);	set_pool_health(*newconfig);	if (oldconfig != NULL)		*oldconfig = zhp->zpool_config;	else		nvlist_free(zhp->zpool_config);	zhp->zpool_config = *newconfig;	return (error);}