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
Signed-off-by: Ahelenia Ziemiańska <[email protected]>
  • Loading branch information
nabijaczleweli committed Jan 12, 2022
1 parent 5079d4e commit 10e55ed
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 @@ -1352,7 +1352,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 @@ -1373,6 +1373,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 10e55ed

Please sign in to comment.