From: Howard Chu Date: Thu, 25 Jan 2007 08:35:27 +0000 (+0000) Subject: Check for duplicate UUIDs due to ITS#4813 patch X-Git-Tag: OPENLDAP_REL_ENG_2_4_4ALPHA~8^2~143 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=c49f17bfdd73b3607a1df79b5ee59085dc7c8869;p=openldap Check for duplicate UUIDs due to ITS#4813 patch --- diff --git a/servers/slapd/syncrepl.c b/servers/slapd/syncrepl.c index 164dfee15f..72374ec545 100644 --- a/servers/slapd/syncrepl.c +++ b/servers/slapd/syncrepl.c @@ -828,9 +828,10 @@ do_syncrep2( struct berval *syncuuid_bv; syncuuid_bv = ber_dupbv( NULL, &syncUUIDs[i] ); slap_sl_free( syncUUIDs[i].bv_val,op->o_tmpmemctx ); - avl_insert( &si->si_presentlist, + if ( avl_insert( &si->si_presentlist, (caddr_t) syncuuid_bv, - syncuuid_cmp, avl_dup_error ); + syncuuid_cmp, avl_dup_error )) + ber_bvfree( syncuuid_bv ); } slap_sl_free( syncUUIDs, op->o_tmpmemctx ); } @@ -1608,8 +1609,11 @@ syncrepl_entry( if (( syncstate == LDAP_SYNC_PRESENT || syncstate == LDAP_SYNC_ADD )) { if ( !si->si_refreshPresent ) { syncuuid_bv = ber_dupbv( NULL, syncUUID ); - avl_insert( &si->si_presentlist, (caddr_t) syncuuid_bv, - syncuuid_cmp, avl_dup_error ); + if ( avl_insert( &si->si_presentlist, (caddr_t) syncuuid_bv, + syncuuid_cmp, avl_dup_error )) { + ber_bvfree( syncuuid_bv ); + syncuuid_bv = NULL; + } } }