From: Pierangelo Masarati Date: Sat, 24 Jul 2004 17:10:29 +0000 (+0000) Subject: cleanup X-Git-Tag: OPENDLAP_REL_ENG_2_2_MP~27 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=075a450b4974fca10210df1f744e8ee2d72681e2;p=openldap cleanup --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index c1bc60faff..afee05201a 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -78,17 +78,17 @@ Attribute *attr_dup( Attribute *a ) tmp->a_vals = ch_malloc((i+1) * sizeof(struct berval)); for( i=0; a->a_vals[i].bv_val != NULL; i++ ) { ber_dupbv( &tmp->a_vals[i], &a->a_vals[i] ); - if( tmp->a_vals[i].bv_val == NULL ) break; + if( BER_BVISNULL( &tmp->a_vals[i] ) ) break; } - tmp->a_vals[i].bv_val = NULL; + BER_BVZERO( &tmp->a_vals[i] ); if( a->a_nvals != a->a_vals ) { tmp->a_nvals = ch_malloc((i+1) * sizeof(struct berval)); for( i=0; a->a_nvals[i].bv_val != NULL; i++ ) { ber_dupbv( &tmp->a_nvals[i], &a->a_nvals[i] ); - if( tmp->a_nvals[i].bv_val == NULL ) break; + if( BER_BVISNULL( &tmp->a_nvals[i] ) ) break; } - tmp->a_nvals[i].bv_val = NULL; + BER_BVZERO( &tmp->a_nvals[i] ); } else { tmp->a_nvals = tmp->a_vals; @@ -197,11 +197,11 @@ attr_merge_normalize( &vals[i], &nvals[i], memctx ); if ( rc != LDAP_SUCCESS ) { - nvals[i+1].bv_val = NULL; + BER_BVZERO( &nvals[i+1] ); goto error_return; } } - nvals[i].bv_val = NULL; + BER_BVZERO( &nvals[i] ); } rc = attr_merge( e, desc, vals, nvals );