]> git.sur5r.net Git - openldap/commitdiff
memory mgmt cleanup
authorJong Hyuk Choi <jongchoi@openldap.org>
Wed, 3 Sep 2003 23:47:37 +0000 (23:47 +0000)
committerJong Hyuk Choi <jongchoi@openldap.org>
Wed, 3 Sep 2003 23:47:37 +0000 (23:47 +0000)
servers/slapd/back-bdb/ctxcsn.c
servers/slapd/back-bdb/search.c
servers/slapd/ctxcsn.c

index 7ca71a0f012d4f1c78cdf79e304cc775a322423b..c8c2cb44f65c1561b0d863f940048666a36b85b6 100644 (file)
@@ -80,6 +80,7 @@ bdb_csn_commit(
                if ( !*ctxcsn_e ) {
                        rs->sr_err = LDAP_OTHER;
                        rs->sr_text = "context csn not present";
+                       ber_bvfree( max_committed_csn );
                        return BDB_CSN_ABORT;
                } else {
                        attr_delete( &(*ctxcsn_e)->e_attrs, slap_schema.si_ad_contextCSN );
@@ -138,6 +139,7 @@ bdb_csn_commit(
                }
 
                *ctxcsn_e = slap_create_context_csn_entry( op->o_bd, max_committed_csn );
+               ber_bvfree( max_committed_csn );
                (*ctxcsn_e)->e_id = ctxcsn_id;
                *ctxcsn_added = 1;
                ret = bdb_dn2id_add( op, tid, *suffix_ei, *ctxcsn_e );
index e98e41fb910d0160864be23e3ae2fc8b334f5c2a..5125c921f4f5c78e146849c78a75b722079a0753 100644 (file)
@@ -674,6 +674,7 @@ dn2entry_retry:
 
 ctxcsn_retry :
                rs->sr_err = bdb_dn2entry( op, NULL, &ctxcsn_ndn, &ctxcsn_ei, 0, locker, &ctxcsn_lock );
+               ch_free( ctxcsn_ndn.bv_val );
 
                switch(rs->sr_err) {
                case 0:
@@ -1332,6 +1333,8 @@ done:
 
        LOCK_ID_FREE (bdb->bi_dbenv, locker );
 
+       ber_bvfree( search_context_csn );
+
        if( rs->sr_v2ref ) {
                ber_bvarray_free( rs->sr_v2ref );
                rs->sr_v2ref = NULL;
index 92c80fa96c075255fc65a5dd053e0193b1cc3569..3de82dcff89637f0c50efb43ecd74a479257aae2 100644 (file)
@@ -263,6 +263,11 @@ slap_create_context_csn_entry(
 #endif
        }
 
+       for ( ml = modlist; ml != NULL; ml = mlnext ) {
+               mlnext = ml->sml_next;
+               free( ml );
+       }
+
        return e;
 }