mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
SLAP_NVALUES: still chasing an extranous free... this just saves
an unneccessary malloc. (Actually, we should likely use local filter structure to read things into and then malloc/copy once we're sure there are no errors.)
This commit is contained in:
parent
6c7a1194c3
commit
19ddf0d63d
@ -354,6 +354,8 @@ get_substring_filter(
|
||||
struct berval value;
|
||||
char *last;
|
||||
struct berval bv;
|
||||
AttributeDescription *ad;
|
||||
|
||||
*text = "error decoding filter";
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
@ -366,18 +368,18 @@ get_substring_filter(
|
||||
return SLAPD_DISCONNECT;
|
||||
}
|
||||
|
||||
f->f_sub = ch_calloc( 1, sizeof(SubstringsAssertion) );
|
||||
f->f_sub_desc = NULL;
|
||||
rc = slap_bv2ad( &bv, &f->f_sub_desc, text );
|
||||
ad = NULL;
|
||||
rc = slap_bv2ad( &bv, &ad, text );
|
||||
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
text = NULL;
|
||||
ch_free( f->f_sub );
|
||||
f->f_choice = SLAPD_FILTER_COMPUTED;
|
||||
f->f_result = SLAPD_COMPARE_UNDEFINED;
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
f->f_sub = ch_calloc( 1, sizeof(SubstringsAssertion) );
|
||||
f->f_sub_desc = ad;
|
||||
f->f_sub_initial.bv_val = NULL;
|
||||
f->f_sub_any = NULL;
|
||||
f->f_sub_final.bv_val = NULL;
|
||||
@ -450,7 +452,6 @@ get_substring_filter(
|
||||
#endif
|
||||
|
||||
value = bv;
|
||||
|
||||
rc = LDAP_PROTOCOL_ERROR;
|
||||
|
||||
switch ( tag ) {
|
||||
@ -531,6 +532,7 @@ return_error:
|
||||
ber_bvarray_free( f->f_sub_any );
|
||||
free( f->f_sub_final.bv_val );
|
||||
ch_free( f->f_sub );
|
||||
f->f_sub = NULL;
|
||||
return rc;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user