sdimitro commented on this pull request.
> for (int i = 0; i < sharearg->zhandle_len; ++i) {
zfs_handle_t *fs_handle =
((zfs_handle_t **)(sharearg->zhandle_arr))[i];
if (fs_handle == NULL) {
+ /* Free non-null elements of the paths array */
+ for (int free_idx = 0; free_idx < *paths_len;
+ ++free_idx) {
+ if ((*paths)[free_idx] != NULL)
+ free((*paths)[free_idx]);
+ }
+ free(*paths);
+ *paths = NULL;
+ *paths_len = 0;
return (SA_SYSTEM_ERR);
}
(*paths)[i] = malloc(sizeof (char) * ZFS_MAXPROPLEN);
err |= sa_get_zfs_share_common(handle, fs_handle, (*paths)[i],
You are right! It seems that this somehow was missed?
That said there shouldn't be any problem as this function is only called by
`sa_init_impl()` and its result is basically discarded. But I do agree that
this is confusing.
--
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/openzfs/openzfs/pull/473#discussion_r141172980
------------------------------------------
openzfs-developer
Archives:
https://openzfs.topicbox.com/groups/developer/discussions/Tcc0964d15893ff46-M0bdbd5e871b6101a1d9466fe
Powered by Topicbox: https://topicbox.com