ITS#3922 fix syncrepl ctxcsn leak

This commit is contained in:
Howard Chu 2005-08-08 12:38:19 +00:00
parent 3858ce0728
commit 9365649dad
5 changed files with 10 additions and 9 deletions

View File

@ -86,7 +86,8 @@ slap_sync_cookie_free(
int
slap_parse_sync_cookie(
struct sync_cookie *cookie
struct sync_cookie *cookie,
void *memctx
)
{
char *csn_ptr;
@ -125,7 +126,7 @@ slap_parse_sync_cookie(
break;
}
if ( valid ) {
ber_str2bv( csn_str, csn_str_len, 1, &cookie->ctxcsn );
ber_str2bv_x( csn_str, csn_str_len, 1, &cookie->ctxcsn, memctx );
} else {
BER_BVZERO( &cookie->ctxcsn );
}

View File

@ -361,7 +361,7 @@ int main( int argc, char **argv )
scp = (struct sync_cookie *) ch_calloc( 1,
sizeof( struct sync_cookie ));
ber_str2bv( optarg, 0, 1, &scp->octet_str );
slap_parse_sync_cookie( scp );
slap_parse_sync_cookie( scp, NULL );
LDAP_STAILQ_FOREACH( scp_entry, &slap_sync_cookie, sc_next ) {
if ( scp->rid == scp_entry->rid ) {

View File

@ -2365,7 +2365,7 @@ static int syncprov_parseCtrl (
sr->sr_rhint = rhint;
if (!BER_BVISNULL(&cookie)) {
ber_dupbv( &sr->sr_state.octet_str, &cookie );
slap_parse_sync_cookie( &sr->sr_state );
slap_parse_sync_cookie( &sr->sr_state, op->o_tmpmemctx );
}
op->o_controls[slap_cids.sc_LDAPsync] = sr;

View File

@ -889,7 +889,7 @@ LDAP_SLAPD_F (void) slap_compose_sync_cookie LDAP_P((
LDAP_SLAPD_F (void) slap_sync_cookie_free LDAP_P((
struct sync_cookie *, int free_cookie ));
LDAP_SLAPD_F (int) slap_parse_sync_cookie LDAP_P((
struct sync_cookie * ));
struct sync_cookie *, void *memctx ));
LDAP_SLAPD_F (int) slap_init_sync_cookie_ctxcsn LDAP_P((
struct sync_cookie * ));
LDAP_SLAPD_F (struct sync_cookie *) slap_dup_sync_cookie LDAP_P((

View File

@ -615,7 +615,7 @@ do_syncrep2(
}
if ( !BER_BVISNULL( &syncCookie.octet_str ) )
{
slap_parse_sync_cookie( &syncCookie );
slap_parse_sync_cookie( &syncCookie, NULL );
}
}
if ( syncrepl_message_to_entry( si, op, msg,
@ -660,7 +660,7 @@ do_syncrep2(
}
if ( !BER_BVISNULL( &syncCookie.octet_str ) )
{
slap_parse_sync_cookie( &syncCookie );
slap_parse_sync_cookie( &syncCookie, NULL );
}
}
if ( ber_peek_tag( ber, &len ) == LDAP_TAG_REFRESHDELETES )
@ -744,7 +744,7 @@ do_syncrep2(
}
if ( !BER_BVISNULL( &syncCookie.octet_str ) )
{
slap_parse_sync_cookie( &syncCookie );
slap_parse_sync_cookie( &syncCookie, NULL );
}
}
if ( ber_peek_tag( ber, &len ) ==
@ -771,7 +771,7 @@ do_syncrep2(
}
if ( !BER_BVISNULL( &syncCookie.octet_str ) )
{
slap_parse_sync_cookie( &syncCookie );
slap_parse_sync_cookie( &syncCookie, NULL );
}
}
if ( ber_peek_tag( ber, &len ) ==