]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/value.c
update for new backend types
[openldap] / servers / slapd / value.c
index 3f0927c29d96efd5e719255364470e7a6cd7142d..aab6b34bc85fb6ae347efc0d2fcce92c70332347 100644 (file)
@@ -312,7 +312,6 @@ ordered_value_sort( Attribute *a, int do_renumber )
        int i, vals;
        int index = 0, noindex = 0, renumber = 0, gotnvals = 0;
        struct berval tmp;
-       char *ptr;
 
        if ( a->a_nvals && a->a_nvals != a->a_vals )
                gotnvals = 1;
@@ -386,6 +385,7 @@ ordered_value_sort( Attribute *a, int do_renumber )
                if ( indexes[0] != 0 || indexes[vals-1] != vals-1 ) {
                        renumber = 1;
                }
+               ch_free( indexes );
        } else {
                renumber = 1;
        }
@@ -453,7 +453,7 @@ ordered_value_match(
                                /* If not equal, or we're only comparing the index,
                                 * return result now.
                                 */
-                               if ( ret || ptr == iv.bv_val + iv.bv_len ) {
+                               if ( ret || ptr == iv.bv_val + iv.bv_len - 1 ) {
                                        *match = ( ret < 0 ) ? -1 : (ret > 0 );
                                        return LDAP_SUCCESS;
                                }