From: Luke Howard Date: Thu, 24 Apr 2003 10:40:45 +0000 (+0000) Subject: Fix crasher in attr_merge_normalize_one() X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~254 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=03fcb6526d8359acadbba58ff1ae8cd6d69ff8e7;p=openldap Fix crasher in attr_merge_normalize_one() --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index d1023d9623..3c5f77d601 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -230,6 +230,7 @@ attr_merge_normalize_one( void *memctx ) { struct berval nval; + struct berval *nvalp; int rc; if ( desc->ad_type->sat_equality->smr_normalize ) { @@ -242,10 +243,15 @@ attr_merge_normalize_one( if ( rc != LDAP_SUCCESS ) { return rc; } + nvalp = &nval; + } else { + nvalp = NULL; } - rc = attr_merge_one( e, desc, val, &nval ); - ch_free( nval.bv_val ); + rc = attr_merge_one( e, desc, val, nvalp ); + if ( nvalp != NULL ) { + ch_free( nval.bv_val ); + } return rc; }