From: Howard Chu Date: Sun, 6 Jun 2010 20:32:53 +0000 (+0000) Subject: ITS#6570 part #1 X-Git-Tag: MIGRATION_CVS2GIT~583 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ea138247b394e46abb8ef106174799ef93ce63f2;p=openldap ITS#6570 part #1 --- diff --git a/servers/slapd/modrdn.c b/servers/slapd/modrdn.c index b4f85f7e55..e2e4bf00ce 100644 --- a/servers/slapd/modrdn.c +++ b/servers/slapd/modrdn.c @@ -445,12 +445,19 @@ slap_modrdn2mods( mod_tmp->sml_values[1].bv_val = NULL; if( desc->ad_type->sat_equality->smr_normalize) { mod_tmp->sml_nvalues = ( BerVarray )ch_malloc( 2 * sizeof( struct berval ) ); - (void) (*desc->ad_type->sat_equality->smr_normalize)( + rs->sr_err = desc->ad_type->sat_equality->smr_normalize( SLAP_MR_EQUALITY|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX, desc->ad_type->sat_syntax, desc->ad_type->sat_equality, &mod_tmp->sml_values[0], &mod_tmp->sml_nvalues[0], NULL ); + if (rs->sr_err != LDAP_SUCCESS) { + ch_free(mod_tmp->sml_nvalues); + ch_free(mod_tmp->sml_values[0].bv_val); + ch_free(mod_tmp->sml_values); + ch_free(mod_tmp); + goto done; + } mod_tmp->sml_nvalues[1].bv_val = NULL; } else { mod_tmp->sml_nvalues = NULL; diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index dc7fb9c583..82ff09d06d 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -1735,8 +1735,9 @@ UTF8StringNormalize( ? LDAP_UTF8_APPROX : 0; val = UTF8bvnormalize( val, &tmp, flags, ctx ); + /* out of memory or syntax error, the former is unlikely */ if( val == NULL ) { - return LDAP_OTHER; + return LDAP_INVALID_SYNTAX; } /* collapse spaces (in place) */