From: Howard Chu Date: Tue, 26 Apr 2005 02:01:19 +0000 (+0000) Subject: ITS#3682, dup entry and free the DB's copy before sending it X-Git-Tag: OPENLDAP_AC_BP~793 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=842b5ce076aa50f4068610880ac467d70e78a5f7;p=openldap ITS#3682, dup entry and free the DB's copy before sending it --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index a88d4897da..f184dd2815 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -976,6 +976,12 @@ syncprov_matchops( Operation *op, opcookie *opc, int saveit ) if ( op->o_tag != LDAP_REQ_ADD ) { op->o_bd->bd_info = (BackendInfo *)on->on_info; rc = be_entry_get_rw( op, fc.fdn, NULL, NULL, 0, &e ); + /* If we're sending responses now, make a copy and unlock the DB */ + if ( e && !saveit ) { + Entry *e2 = entry_dup( e ); + be_entry_release_rw( op, e, 0 ); + e = e2; + } op->o_bd->bd_info = (BackendInfo *)on; if ( rc ) return; } else {