]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#10408 Do not assume sop is still in the list 807/head
authorOndřej Kuzník <ondra@mistotebe.net>
Wed, 26 Nov 2025 13:55:54 +0000 (13:55 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Thu, 4 Dec 2025 22:46:36 +0000 (22:46 +0000)
servers/slapd/overlays/syncprov.c

index 6f1eefbc35ef48b9a255aa8b00e27d002427661e..a30b584e163091a9eff3ee2d9955e63aeffc8d27 100644 (file)
@@ -3340,12 +3340,15 @@ aband:
                                        ctxcsn[j].bv_val);
 bailout:
                                if ( sop ) {
-                                       syncops **sp = &si->si_ops;
+                                       syncops **sp;
 
                                        ldap_pvt_thread_mutex_lock( &si->si_ops_mutex );
-                                       while ( *sp != sop )
-                                               sp = &(*sp)->s_next;
-                                       *sp = sop->s_next;
+                                       for ( sp = &si->si_ops; *sp; sp = &(*sp)->s_next ) {
+                                               if ( *sp == sop ) {
+                                                       *sp = sop->s_next;
+                                                       break;
+                                               }
+                                       }
                                        ldap_pvt_thread_mutex_unlock( &si->si_ops_mutex );
                                        ch_free( sop->s_base.bv_val );
                                        ch_free( sop );