fix libzfs diff mem leak in an error path

Reviewed-by: Brian Behlendorf <[email protected]>
Reviewed-by: Alexander Motin <[email protected]>
Signed-off-by: Alek Pinchuk <[email protected]>
Closes #18301
This commit is contained in:
Alek P authored and GitHub committed 2026-03-10 12:39:49 -07:00
1 parent 5b93d1a218
commit ae7fcd5f92
1 file changed
+1 -1
+1 -1
View File
@@ -821,10 +821,10 @@ zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
(void) close(pipefd[1]);
(void) pthread_join(tid, NULL);
teardown_differ_info(&di);
if (di.zerr != 0) {
zfs_error_aux(zhp->zfs_hdl, "%s", zfs_strerror(di.zerr));
return (zfs_error(zhp->zfs_hdl, EZFS_DIFF, di.errbuf));
}
teardown_differ_info(&di);
return (0);
}