Print this page
3743 zfs needs a refcount audit
Submitted by:   Will Andrews <willa@spectralogic.com>
Submitted by:   Justin Gibbs <justing@spectralogic.com>
Reviewed by:    Matthew Ahrens <mahrens@delphix.com>

@@ -181,12 +181,14 @@
 
                 name_to_bookmark(za.za_name, &zb);
 
                 if (copyout(&zb, (char *)addr +
                     (*count - 1) * sizeof (zbookmark_t),
-                    sizeof (zbookmark_t)) != 0)
+                    sizeof (zbookmark_t)) != 0) {
+                        zap_cursor_fini(&zc);
                         return (SET_ERROR(EFAULT));
+                }
 
                 *count -= 1;
         }
 
         zap_cursor_fini(&zc);