]> git.ipfire.org Git - thirdparty/openldap.git/commitdiff
ITS#4673 fix from HEAD
authorHoward Chu <hyc@openldap.org>
Fri, 15 Sep 2006 00:43:55 +0000 (00:43 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 15 Sep 2006 00:43:55 +0000 (00:43 +0000)
servers/slapd/overlays/translucent.c

index cc1357a57bcdba776ee0a626389ad6730e4361a8..4fae3d92bf1b1cbfa754decce049609d492dc19a 100644 (file)
@@ -296,11 +296,10 @@ static int translucent_modify(Operation *op, SlapReply *rs) {
                                        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;
-                               m = m->sml_next;
-                               mm->sml_next = NULL;            /* hack */
-                               slap_mods_free(mm, 1);
-                               if(m) continue;
+                               m->sml_next = NULL;
+                               slap_mods_free(m, 1);
+                               m = mm;
+                               continue;
                        }
                        m->sml_op = LDAP_MOD_ADD;
                }
@@ -360,7 +359,7 @@ release:
                a = ch_calloc(1, sizeof(Attribute));
                a->a_desc  = m->sml_desc;
                a->a_vals  = m->sml_values;
-               a->a_nvals = m->sml_nvalues;
+               a->a_nvals = m->sml_nvalues ? m->sml_nvalues : a->a_vals;
                a->a_next  = ax;
                ax = a;
        }