]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/filter.c
error message from be_entry_put tool backend function
[openldap] / servers / slapd / filter.c
index aad1a41a08438da0a94d6f64d867378c879b823b..7ebb83100afa5a3a803539ae4593a8c08d5d0471 100644 (file)
@@ -1,7 +1,7 @@
 /* filter.c - routines for parsing and dealing with filters */
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -204,7 +204,7 @@ get_filter(
 #else
                Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
 #endif
-               if ( ber_scanf( ber, "o", &type ) == LBER_ERROR ) {
+               if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) {
                        err = SLAPD_DISCONNECT;
                        *text = "error decoding filter";
                        break;
@@ -219,13 +219,10 @@ get_filter(
                        f->f_result = LDAP_COMPARE_FALSE;
                        ber_str2bv("(unrecognized=*)",
                                sizeof("(unrecognized=*)")-1, 1, fstr);
-                       ch_free( type.bv_val );
                        err = LDAP_SUCCESS;
                        break;
                }
 
-               ch_free( type.bv_val );
-
                fstr->bv_len = sizeof("(=*)") - 1 
                        + f->f_desc->ad_cname.bv_len;
                fstr->bv_val = ch_malloc( fstr->bv_len + 1);
@@ -362,7 +359,7 @@ get_filter(
                break;
        }
 
-       free( ftmp.bv_val );
+       if ( ftmp.bv_val ) free( ftmp.bv_val );
 
        if ( err != LDAP_SUCCESS ) {
                if ( fstr->bv_val != NULL ) {
@@ -467,7 +464,7 @@ get_substring_filter(
 #else
        Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
 #endif
-       if ( ber_scanf( ber, "{o" /*}*/, &bv ) == LBER_ERROR ) {
+       if ( ber_scanf( ber, "{m" /*}*/, &bv ) == LBER_ERROR ) {
                return SLAPD_DISCONNECT;
        }
 
@@ -475,8 +472,6 @@ get_substring_filter(
        f->f_sub_desc = NULL;
        rc = slap_bv2ad( &bv, &f->f_sub_desc, text );
 
-       ch_free( bv.bv_val );
-
        if( rc != LDAP_SUCCESS ) {
                text = NULL;
                ch_free( f->f_sub );
@@ -500,7 +495,7 @@ get_substring_filter(
        {
                unsigned usage;
 
-               rc = ber_scanf( ber, "o", &value );
+               rc = ber_scanf( ber, "m", &value );
                if ( rc == LBER_ERROR ) {
                        rc = SLAPD_DISCONNECT;
                        goto return_error;
@@ -536,12 +531,10 @@ get_substring_filter(
                                "  unknown substring choice=%ld\n",
                                (long) tag, 0, 0 );
 #endif
-                       free( value.bv_val );
                        goto return_error;
                }
 
                rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text );
-               free( value.bv_val );
 
                if( rc != LDAP_SUCCESS ) {
                        goto return_error;
@@ -734,6 +727,10 @@ filter_free( Filter *f )
                }
                break;
 
+       case LDAP_FILTER_EXT:
+               mra_free( f->f_mra, 1 );
+               break;
+
        case SLAPD_FILTER_COMPUTED:
                break;