libzfs: memory leak in iter_dependents_cb()
There is a memory leak in iter_dependents_cb(). It is expected that the iter_dependents_cb() calls zfs_close() for the passed zhp. It is true for all codepaths, except this one:
446 if (!first && err == 0) 447 err = ida->func(zhp, ida->data); 448 return (err);
The ida->func() is calling the zfs_close(zhp) too, but in a case the condition at line 446 is false the zfs_close() is not called.
To reproduce the issue download attached leaks_rename.c and leaks_rename.sh and run leaks_rename.sh.