]> git.sur5r.net Git - openldap/commitdiff
ITS#4237 don't update sc_prev after a callback has been freed.
authorHoward Chu <hyc@openldap.org>
Thu, 1 Dec 2005 00:48:38 +0000 (00:48 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 1 Dec 2005 00:48:38 +0000 (00:48 +0000)
servers/slapd/result.c

index 29bdb2ff7e098d08624b5a96b9fbfa8a7a88d5ac..2636d51d6b769a522bd34763233437f9d14e70ae 100644 (file)
@@ -308,11 +308,13 @@ send_ldap_response(
                for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
                        sc_next = op->o_callback->sc_next;
                        if ( op->o_callback->sc_response ) {
+                               slap_callback *sc2 = op->o_callback;
                                rc = op->o_callback->sc_response( op, rs );
-                               if ( op->o_callback != *sc_prev ) {
+                               if ( op->o_callback != sc2 ) {
                                        *sc_prev = op->o_callback;
                                }
                                if ( rc != SLAP_CB_CONTINUE || !op->o_callback ) break;
+                               if ( op->o_callback != sc2 ) continue;
                        }
                        sc_prev = &op->o_callback->sc_next;
                }
@@ -461,11 +463,13 @@ clean2:;
                for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
                        sc_next = op->o_callback->sc_next;
                        if ( op->o_callback->sc_cleanup ) {
+                               slap_callback *sc2 = op->o_callback;
                                (void)op->o_callback->sc_cleanup( op, rs );
-                               if ( op->o_callback != *sc_prev ) {
+                               if ( op->o_callback != sc2 ) {
                                        *sc_prev = op->o_callback;
                                }
                                if ( !op->o_callback ) break;
+                               if ( op->o_callback != sc2 ) continue;
                        }
                        sc_prev = &op->o_callback->sc_next;
                }
@@ -718,11 +722,13 @@ slap_send_search_entry( Operation *op, SlapReply *rs )
                {
                        sc_next = op->o_callback->sc_next;
                        if ( op->o_callback->sc_response ) {
+                               slap_callback *sc2 = op->o_callback;
                                rc = op->o_callback->sc_response( op, rs );
-                               if ( op->o_callback != *sc_prev ) {
+                               if ( op->o_callback != sc2 ) {
                                        *sc_prev = op->o_callback;
                                }
                                if ( rc != SLAP_CB_CONTINUE || !op->o_callback ) break;
+                               if ( op->o_callback != sc2 ) continue;
                        }
                        sc_prev = &op->o_callback->sc_next;
                }
@@ -1172,11 +1178,13 @@ error_return:;
                for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
                        sc_next = op->o_callback->sc_next;
                        if ( op->o_callback->sc_cleanup ) {
+                               slap_callback *sc2 = op->o_callback;
                                (void)op->o_callback->sc_cleanup( op, rs );
-                               if ( op->o_callback != *sc_prev ) {
+                               if ( op->o_callback != sc2 ) {
                                        *sc_prev = op->o_callback;
                                }
                                if ( !op->o_callback ) break;
+                               if ( op->o_callback != sc2 ) continue;
                        }
                        sc_prev = &op->o_callback->sc_next;
                }
@@ -1230,11 +1238,13 @@ slap_send_search_reference( Operation *op, SlapReply *rs )
                for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
                        sc_next = op->o_callback->sc_next;
                        if ( op->o_callback->sc_response ) {
+                               slap_callback *sc2 = op->o_callback;
                                rc = op->o_callback->sc_response( op, rs );
-                               if ( op->o_callback != *sc_prev ) {
+                               if ( op->o_callback != sc2 ) {
                                        *sc_prev = op->o_callback;
                                }
                                if ( rc != SLAP_CB_CONTINUE || !op->o_callback ) break;
+                               if ( op->o_callback != sc2 ) continue;
                        }
                        sc_prev = &op->o_callback->sc_next;
                }
@@ -1371,11 +1381,13 @@ rel:
                for ( sc_next = op->o_callback; sc_next; op->o_callback = sc_next) {
                        sc_next = op->o_callback->sc_next;
                        if ( op->o_callback->sc_cleanup ) {
+                               slap_callback *sc2 = op->o_callback;
                                (void)op->o_callback->sc_cleanup( op, rs );
-                               if ( op->o_callback != *sc_prev ) {
+                               if ( op->o_callback != sc2 ) {
                                        *sc_prev = op->o_callback;
                                }
                                if ( rc != SLAP_CB_CONTINUE || !op->o_callback ) break;
+                               if ( op->o_callback != sc2 ) continue;
                        }
                        sc_prev = &op->o_callback->sc_next;
                }