]> git.sur5r.net Git - openldap/commitdiff
Plug slapindex memleak
authorHoward Chu <hyc@openldap.org>
Mon, 3 Dec 2012 19:39:14 +0000 (11:39 -0800)
committerQuanah Gibson-Mount <quanah@openldap.org>
Tue, 4 Dec 2012 01:11:23 +0000 (17:11 -0800)
servers/slapd/back-mdb/tools.c

index b08aa869ce715d93ebbb103dcccd390ed6135337..4dcfdb0fbc37543a6098e6af854382162dc28290 100644 (file)
@@ -858,6 +858,7 @@ done:
                                        mdb_strerror(rc), rc, 0 );
                                e->e_id = NOID;
                        }
+                       mdb_cursor_close( cursor );
                        txi = NULL;
                        /* Must close the read txn to allow old pages to be reclaimed. */
                        mdb_txn_abort( txn );
@@ -872,6 +873,8 @@ done:
        } else {
                unsigned i;
                mdb_writes = 0;
+               mdb_cursor_close( cursor );
+               cursor = NULL;
                mdb_txn_abort( txi );
                for ( i=0; i<mi->mi_nattrs; i++ )
                        mi->mi_attrs[i]->ai_cursor = NULL;