]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/slapi/slapi_utils.c
To conform to the SLAPI spec, slapi_filter_get_ava() should not duplicate
[openldap] / servers / slapd / slapi / slapi_utils.c
index 47095742a29f34190e33a033e840f9aa0a7e381d..6f722ebfd3e5109be4f07c39136608e84e83b9d7 100644 (file)
@@ -1099,34 +1099,16 @@ slapi_filter_get_ava(
                        || ftype ==  LDAP_FILTER_GE 
                        || ftype == LDAP_FILTER_LE 
                        || ftype == LDAP_FILTER_APPROX ) {
-               *type = slapi_ch_strdup( f->f_un.f_un_ava->aa_desc->ad_cname.bv_val );
-               if ( *type == NULL ) {
-                       rc = LDAP_NO_MEMORY;
-                       goto done;
-               }
-
-               *bval = ber_dupbv( NULL, &f->f_un.f_un_ava->aa_value );
-               if ( *bval == NULL ) {
-                       rc = LDAP_NO_MEMORY;
-                       goto done;
-               }
+               /*
+                * According to the SLAPI Reference Manual these are
+                * not duplicated.
+                */
+               *type = f->f_un.f_un_ava->aa_desc->ad_cname.bv_val;
+               *bval = &f->f_un.f_un_ava->aa_value;
        } else { /* filter type not supported */
                rc = -1;
        }
 
-done:
-       if ( rc != LDAP_SUCCESS ) {
-               if ( *bval ) {
-                       ch_free( *bval );
-                       *bval = NULL;
-               }
-
-               if ( *type ) {
-                       ch_free( *type );
-                       *type = NULL;
-               }
-       }
-
        return rc;
 #else /* !defined(LDAP_SLAPI) */
        return -1;