mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-28 02:29:34 -05:00
To conform to the SLAPI spec, slapi_filter_get_ava() should not duplicate
for caller
This commit is contained in:
parent
561ab80de0
commit
3dad7cae7b
1 changed files with 6 additions and 24 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue