consul: Fixing issue with cursors not closing in MDB

This commit is contained in:
Armon Dadgar 2014-03-25 13:30:19 -07:00
parent ab5a3d3721
commit 966daed094
1 changed files with 2 additions and 0 deletions

View File

@ -157,6 +157,7 @@ func (t *MDBTable) restoreLastRowID() error {
if err != nil {
return err
}
defer cursor.Close()
key, _, err := cursor.Get(nil, mdb.LAST)
if err == mdb.NotFound {
@ -534,6 +535,7 @@ func (i *MDBIndex) iterate(tx *MDBTxn, prefix []byte,
if err != nil {
return err
}
defer cursor.Close()
var key, encRowId, objBytes []byte
first := true