]> git.sur5r.net Git - openldap/commitdiff
Reset BackendInfo to original value after checkpoint. Plugs a memory leak
authorQuanah Gibson-Mount <quanah@openldap.org>
Thu, 10 Jun 2010 19:21:21 +0000 (19:21 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 10 Jun 2010 19:21:21 +0000 (19:21 +0000)
when deleting the syncprov overlay from a database (when compiled with
-DSLAP_CONFIG_DELETE)

servers/slapd/overlays/syncprov.c

index ce071ca0ff16401f19f1935eb008716f660b3814..0e8afedaa078f43126040da0b35c15d7a8ff4dd6 100644 (file)
@@ -1413,6 +1413,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;
@@ -1442,6 +1443,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;
@@ -1459,6 +1461,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 );