From: Pierangelo Masarati Date: Tue, 12 Apr 2005 16:35:52 +0000 (+0000) Subject: fix previous commit (ITS#3654) X-Git-Tag: OPENLDAP_AC_BP~917 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6f1ebb180ea944ce7f2e3f2803ee1bd7824c97f7;p=openldap fix previous commit (ITS#3654) --- diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 6fb1a5ad69..5154acfbc9 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -177,11 +177,22 @@ do_add( Operation *op, SlapReply *rs ) op->o_bd = frontendDB; rc = frontendDB->be_add( op, rs ); if ( rc == 0 ) { - if ( op->ora_e ) { + /* FIXME: temporary? */ + assert( op->ora_e != NULL ); + assert( op->o_private != NULL ); + + if ( op->ora_e != NULL ) { + BackendDB *bd = op->o_bd; + + op->o_bd = (BackendDB *)op->o_private; + op->o_private = NULL; + be_entry_release_w( op, op->ora_e ); + op->ora_e = NULL; + op->o_bd = bd; + op->o_private = NULL; } - op->ora_e = NULL; } done:; @@ -338,12 +349,12 @@ fe_op_add( Operation *op, SlapReply *rs ) op->o_callback = &cb; } rc = op->o_bd->be_add( op, rs ); - if ( rc != 0 ) { + if ( rc == LDAP_SUCCESS ) { /* NOTE: be_entry_release_w() is * called by do_add(), so that global * overlays on the way back can * at least read the entry */ - op->ora_e = NULL; + op->o_private = op->o_bd; } #ifndef SLAPD_MULTIMASTER