]> git.sur5r.net Git - openldap/commitdiff
Look for our callback to pop, don't just do it blindly
authorHoward Chu <hyc@openldap.org>
Wed, 19 Aug 2009 08:05:18 +0000 (08:05 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 19 Aug 2009 08:05:18 +0000 (08:05 +0000)
servers/slapd/backover.c

index 1be6cfa3e9000e8034454bd54e9ac0a83a65832b..ffa0251293fe48fce9f68f74741974408f1ecb97 100644 (file)
@@ -699,7 +699,7 @@ over_op_func(
        slap_overinfo *oi;
        slap_overinst *on;
        BackendDB *be = op->o_bd, db;
-       slap_callback cb = {NULL, over_back_response, NULL, NULL};
+       slap_callback cb = {NULL, over_back_response, NULL, NULL}, **sc;
        int rc = SLAP_CB_CONTINUE;
 
        /* FIXME: used to happen for instance during abandon
@@ -719,9 +719,14 @@ over_op_func(
        op->o_callback = &cb;
 
        rc = overlay_op_walk( op, rs, which, oi, on );
+       for ( sc = &op->o_callback; *sc; sc = &(*sc)->sc_next ) {
+               if ( *sc == &cb ) {
+                       *sc = cb.sc_next;
+                       break;
+               }
+       }
 
        op->o_bd = be;
-       op->o_callback = cb.sc_next;
        return rc;
 }