]> git.sur5r.net Git - openldap/commitdiff
minor cleanup
authorPierangelo Masarati <ando@openldap.org>
Thu, 9 Dec 2004 23:11:08 +0000 (23:11 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 9 Dec 2004 23:11:08 +0000 (23:11 +0000)
servers/slapd/add.c

index 4b392247836ca4f5a5e3a283bef7c81b42a7ec23..306b65ee695a474cc69467ede685f0d45eb9f431 100644 (file)
@@ -193,6 +193,7 @@ fe_op_add( Operation *op, SlapReply *rs )
        Entry           *e = op->ora_e;
        Modifications   *modlist = op->ora_modlist;
        Modifications   **modtail = &modlist;
+       int             rc = 0;
 
        manageDSAit = get_manageDSAit( op );
 
@@ -306,7 +307,12 @@ fe_op_add( Operation *op, SlapReply *rs )
                                cb.sc_next = op->o_callback;
                                op->o_callback = &cb;
                        }
-                       if ( (op->o_bd->be_add)( op, rs ) == 0 ) {
+                       rc = (op->o_bd->be_add)( op, rs );
+                       if ( rc == 0 ) {
+                               /* FIXME: be_entry_release_w() should be
+                                * called by do_add(), so that global
+                                * overlays on the way back can
+                                * at least read the entry */
                                be_entry_release_w( op, e );
                                e = NULL;
                        }
@@ -370,7 +376,7 @@ fe_op_add( Operation *op, SlapReply *rs )
 #endif /* LDAP_SLAPI */
 
 done:;
-       return rs->sr_err;
+       return rc;
 }
 
 int