From: Ralf Haferkamp Date: Thu, 29 Apr 2010 15:47:27 +0000 (+0000) Subject: Reset BackendInfo to original value after checkpoint. Plugs a memory leak X-Git-Tag: MIGRATION_CVS2GIT~598 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=5743591419e2807ad5a8801ebb68347a9032cfeb;p=openldap Reset BackendInfo to original value after checkpoint. Plugs a memory leak when deleting the syncprov overlay from a database (when compiled with -DSLAP_CONFIG_DELETE) --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index c368a50fb7..160c3bf94f 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -1414,6 +1414,7 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on ) SlapReply rsm = { 0 }; slap_callback cb = {0}; BackendDB be; + BackendInfo *bi; #ifdef CHECK_CSN Syntax *syn = slap_schema.si_ad_contextCSN->ad_type->sat_syntax; @@ -1443,6 +1444,7 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on ) } opm.o_req_dn = si->si_contextdn; opm.o_req_ndn = si->si_contextdn; + bi = opm.o_bd->bd_info; opm.o_bd->bd_info = on->on_info->oi_orig; opm.o_managedsait = SLAP_CONTROL_NONCRITICAL; opm.o_no_schema_check = 1; @@ -1460,6 +1462,7 @@ syncprov_checkpoint( Operation *op, SlapReply *rs, slap_overinst *on ) if ( e == opm.ora_e ) be_entry_release_w( &opm, opm.ora_e ); } + opm.o_bd->bd_info = bi; if ( mod.sml_next != NULL ) { slap_mods_free( mod.sml_next, 1 );