Skip to content

Commit

Permalink
libzfs: mount: don't leak mnt_param_t if mnt_func fails
Browse files Browse the repository at this point in the history
Reviewed-by: Brian Behlendorf <[email protected]>
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
Closes openzfs#12968
  • Loading branch information
nabijaczleweli authored and tonyhutter committed Jun 6, 2022
1 parent 2712411 commit 56eed50
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/libzfs/libzfs_mount.c
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,7 @@ zfs_mount_task(void *arg)
sizeof (mountpoint), NULL, NULL, 0, B_FALSE) == 0);

if (mp->mnt_func(handles[idx], mp->mnt_data) != 0)
return;
goto out;

/*
* We dispatch tasks to mount filesystems with mountpoints underneath
Expand All @@ -1369,6 +1369,8 @@ zfs_mount_task(void *arg)
zfs_dispatch_mount(mp->mnt_hdl, handles, num_handles, i,
mp->mnt_func, mp->mnt_data, mp->mnt_tp);
}

out:
free(mp);
}

Expand Down

0 comments on commit 56eed50

Please sign in to comment.