From: Jong Hyuk Choi Date: Wed, 3 Sep 2003 23:47:37 +0000 (+0000) Subject: memory mgmt cleanup X-Git-Tag: OPENLDAP_REL_ENG_2_1_MP~748 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=7357caac90a86f740f2d91e1d1a195b285a9e4ae;p=openldap memory mgmt cleanup --- diff --git a/servers/slapd/back-bdb/ctxcsn.c b/servers/slapd/back-bdb/ctxcsn.c index 7ca71a0f01..c8c2cb44f6 100644 --- a/servers/slapd/back-bdb/ctxcsn.c +++ b/servers/slapd/back-bdb/ctxcsn.c @@ -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 ); diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index e98e41fb91..5125c921f4 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -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; diff --git a/servers/slapd/ctxcsn.c b/servers/slapd/ctxcsn.c index 92c80fa96c..3de82dcff8 100644 --- a/servers/slapd/ctxcsn.c +++ b/servers/slapd/ctxcsn.c @@ -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; }