translucent_info *ov = on->on_bi.bi_private;
        Entry *e = NULL, *re = NULL;
        Attribute *a, *ax;
-       Modifications *m, *mm;
+       Modifications *m, **mm;
        int del, rc, erc = 0;
        slap_callback cb = { 0 };
 
 
        if(e && rc == LDAP_SUCCESS) {
                Debug(LDAP_DEBUG_TRACE, "=> translucent_modify: found local entry\n", 0, 0, 0);
-               for(m = op->orm_modlist; m; m = m->sml_next) {
+               for(mm = &op->orm_modlist; *mm; ) {
+                       m = *mm;
+                       mm = &m->sml_next;
                        for(a = e->e_attrs; a; a = a->a_next)
                                if(a->a_desc == m->sml_desc) break;
                        if(a) continue;         /* found local attr */
                                Debug(LDAP_DEBUG_TRACE,
                                        "=> translucent_modify: silently dropping delete: %s\n",
                                        m->sml_desc->ad_cname.bv_val, 0, 0);
-                               for(mm = op->orm_modlist; mm->sml_next != m; mm = mm->sml_next);
-                               mm->sml_next = m->sml_next;
+                               *mm = m->sml_next;
                                m->sml_next = NULL;
                                slap_mods_free(m, 1);
-                               m = mm;
                                continue;
                        }
                        m->sml_op = LDAP_MOD_ADD;