]> git.sur5r.net Git - openldap/commitdiff
ITS#7150 fix check for already abandoned op
authorHoward Chu <hyc@openldap.org>
Fri, 3 Feb 2012 17:35:13 +0000 (09:35 -0800)
committerHoward Chu <hyc@openldap.org>
Fri, 3 Feb 2012 17:35:13 +0000 (09:35 -0800)
servers/slapd/overlays/syncprov.c

index a9c30ae8dc1e50a009ef1c5cd924b21c6ad36d13..8c6c296feb4296b55c459930a187122b8658cd9a 100644 (file)
@@ -2115,10 +2115,12 @@ syncprov_op_mod( Operation *op, SlapReply *rs )
                                /* clean up if the caller is giving up */
                                if ( op->o_abandon ) {
                                        modinst *m2;
-                                       for ( m2 = mt->mt_mods; m2->mi_next != mi;
+                                       for ( m2 = mt->mt_mods; m2 && m2->mi_next != mi;
                                                m2 = m2->mi_next );
-                                       m2->mi_next = mi->mi_next;
-                                       if ( mt->mt_tail == mi ) mt->mt_tail = m2;
+                                       if ( m2 ) {
+                                               m2->mi_next = mi->mi_next;
+                                               if ( mt->mt_tail == mi ) mt->mt_tail = m2;
+                                       }
                                        op->o_tmpfree( cb, op->o_tmpmemctx );
                                        ldap_pvt_thread_mutex_unlock( &mt->mt_mutex );
                                        return SLAPD_ABANDON;