]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/syncrepl.c
Fix memory leaks from ITS#6310 (logged as ITS#6387)
[openldap] / servers / slapd / syncrepl.c
index 9b6d4d3c001dc7f6b2af5de1331eee865862e2c3..7a4e6d41181d164ad29428aab4713889f17dd8c2 100644 (file)
@@ -857,6 +857,7 @@ do_syncrep2(
                                        slap_parse_sync_cookie( &syncCookie, NULL );
                                        if ( syncCookie.ctxcsn ) {
                                                int i, sid = slap_parse_csn_sid( syncCookie.ctxcsn );
+                                               check_syncprov( op, si );
                                                for ( i =0; i<si->si_cookieState->cs_num; i++ ) {
                                                        if ( si->si_cookieState->cs_sids[i] == sid && 
                                                                ber_bvcmp( syncCookie.ctxcsn, &si->si_cookieState->cs_vals[i] ) <= 0 ) {
@@ -3718,7 +3719,7 @@ syncinfo_free( syncinfo_t *sie, int free_all )
                if ( sie->si_logbase.bv_val ) {
                        ch_free( sie->si_logbase.bv_val );
                }
-               if ( SLAP_SYNC_SUBENTRY( sie->si_be )) {
+               if ( sie->si_be && SLAP_SYNC_SUBENTRY( sie->si_be )) {
                        ch_free( sie->si_contextdn.bv_val );
                }
                if ( sie->si_attrs ) {
@@ -3930,6 +3931,12 @@ parse_syncrepl_retry(
                        }
                }
        }
+       if ( j < 1 || si->si_retrynum_init[j-1] != RETRYNUM_FOREVER ) {
+               Debug( LDAP_DEBUG_CONFIG,
+                       "%s: syncrepl will eventually stop retrying; the \"retry\" parameter should end with a '+'.\n",
+                       c->log, 0, 0 );
+       }
+
        si->si_retrynum_init[j] = RETRYNUM_TAIL;
        si->si_retrynum[j] = RETRYNUM_TAIL;
        si->si_retryinterval[j] = 0;