From: Luke Howard Date: Wed, 22 Jan 2003 15:07:23 +0000 (+0000) Subject: To conform to the SLAPI spec, slapi_filter_get_ava() should not duplicate X-Git-Tag: NO_SLAP_OP_BLOCKS~538 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=3dad7cae7b302f1df2184ca33ff008a0fbf1ebd7;p=openldap To conform to the SLAPI spec, slapi_filter_get_ava() should not duplicate for caller --- diff --git a/servers/slapd/slapi/slapi_utils.c b/servers/slapd/slapi/slapi_utils.c index 47095742a2..6f722ebfd3 100644 --- a/servers/slapd/slapi/slapi_utils.c +++ b/servers/slapd/slapi/slapi_utils.c @@ -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;