memory mgmt cleanup

This commit is contained in:
Jong Hyuk Choi 2003-09-03 23:47:37 +00:00
parent 7f882daf15
commit 7357caac90
3 changed files with 10 additions and 0 deletions

View 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 );

View 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;

View 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;
}