diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index fea49e3ab1..d1538d1466 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -883,6 +883,10 @@ zfs_send_progress(zfs_handle_t *zhp, int fd, uint64_t *bytes_written, { zfs_cmd_t zc = {"\0"}; + if (bytes_written != NULL) + *bytes_written = 0; + if (blocks_visited != NULL) + *blocks_visited = 0; (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name)); zc.zc_cookie = fd; if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0)