]> git.sur5r.net Git - openldap/commitdiff
ITS#6570 part #1
authorHoward Chu <hyc@openldap.org>
Sun, 6 Jun 2010 20:32:53 +0000 (20:32 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 6 Jun 2010 20:32:53 +0000 (20:32 +0000)
servers/slapd/modrdn.c
servers/slapd/schema_init.c

index b4f85f7e5583645a85c390ed0ff78db7f0f911cc..e2e4bf00ce029503ab109d0fb8e7df7164c469b4 100644 (file)
@@ -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;
index dc7fb9c5838b550c89fa17bc040c5235ded40f72..82ff09d06d726aa8417b7d623d4994f868aa38b2 100644 (file)
@@ -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) */