]> git.sur5r.net Git - openldap/commitdiff
Fix modify_delete_values. This stuff should be completely rewritten
authorHoward Chu <hyc@openldap.org>
Wed, 26 Feb 2003 09:55:07 +0000 (09:55 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 26 Feb 2003 09:55:07 +0000 (09:55 +0000)
to take full advantage of SLAP_NVALUES.

servers/slapd/mods.c

index 72a8e60308ab217aa53d0a9f28017d882736f58f..0fed9643b45f1a6e997ed71b22d5471f9b7f3ff3 100644 (file)
@@ -615,6 +615,12 @@ modify_delete_values(
 
                if ( j != k ) {
                        a->a_vals[ j ] = a->a_vals[ k ];
+#ifdef SLAP_NVALUES
+                       if (a->a_nvals) {
+                               free( a->a_nvals[j].bv_val );
+                               a->a_nvals[ j ] = a->a_nvals[ k ];
+                       }
+#endif
                }
 
                if ( a->a_vals[ k ].bv_val == NULL ) {
@@ -622,6 +628,9 @@ modify_delete_values(
                }
        }
        a->a_vals[ j ].bv_val = NULL;
+#ifdef SLAP_NVALUES
+       a->a_nvals[ j ].bv_val = NULL;
+#endif
 
        assert( i == k - j );