diff -ur globus_openldap.shipped/openldap-2.0.22/servers/slapd/schema_init.c globus_openldap/openldap-2.0.22/servers/slapd/schema_init.c --- globus_openldap.shipped/openldap-2.0.22/servers/slapd/schema_init.c 2002-01-15 19:55:55.000000000 +0100 +++ globus_openldap/openldap-2.0.22/servers/slapd/schema_init.c 2004-11-24 15:52:09.000000000 +0100 @@ -1963,20 +1963,23 @@ struct berval *newval; char *p, *q; - newval = ch_malloc( sizeof( struct berval ) ); - p = val->bv_val; + if( p == NULL ) { + return LDAP_INVALID_SYNTAX; + } + /* Ignore initial whitespace */ while ( ASCII_SPACE( *p ) ) { p++; } if( *p == '\0' ) { - ch_free( newval ); return LDAP_INVALID_SYNTAX; } + newval = ch_malloc( sizeof( struct berval ) ); + newval->bv_val = ch_strdup( p ); p = q = newval->bv_val;