5814 bpobj_iterate_impl(): Close a refcount leak iterating on a sublist.
Reviewed by: Prakash Surya <prakash.surya@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Paul Dagnelie <paul.dagnelie@delphix.com>
Reviewed by: Simon Klinkert <simon.klinkert@gmail.com>
Approved by: Gordon Ross <gwr@nexenta.com>
References:
https://www.illumos.org/issues/5814
https://github.com/illumos/illumos-gate/commit/
b67dde11
Ported-by: DHE <git@dehacked.net>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #3368
if (free) {
err = bpobj_space(&sublist,
&used_before, &comp_before, &uncomp_before);
- if (err)
+ if (err != 0) {
+ bpobj_close(&sublist);
break;
+ }
}
err = bpobj_iterate_impl(&sublist, func, arg, tx, free);
if (free) {