Print this page
patch fix

@@ -1566,14 +1566,17 @@
                  * read-only, so check the in-core state to see if it's
                  * active and imported read-only.  If it is, set
                  * its state to active.
                  */
                 if (pool_active(hdl, name, guid, &isactive) == 0 && isactive &&
-                    (zhp = zpool_open_canfail(hdl, name)) != NULL &&
-                    zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL))
+                    (zhp = zpool_open_canfail(hdl, name)) != NULL) {
+                        if (zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL))
                         stateval = POOL_STATE_ACTIVE;
 
+                        zpool_close(zhp);
+                }
+
                 ret = B_TRUE;
                 break;
 
         case POOL_STATE_ACTIVE:
                 /*