Skip to content
Snippets Groups Projects
Commit 3dad7cae authored by Luke Howard's avatar Luke Howard
Browse files

To conform to the SLAPI spec, slapi_filter_get_ava() should not duplicate

for caller
parent 561ab80d
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment