From: Kurt Zeilenga Date: Fri, 20 Aug 1999 22:59:00 +0000 (+0000) Subject: Stop mergers if dup returns NULL. X-Git-Tag: TWEB_OL_BASE~134 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=387186fc339338fe9c2c5f674a73db071711c848;p=openldap Stop mergers if dup returns NULL. --- diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index 2aadf7056c..9bde8bc6b7 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -67,6 +67,8 @@ Attribute *attr_dup( Attribute *a ) for( i=0; a->a_vals[i] != NULL; i++ ) { tmp->a_vals[i] = ber_bvdup( a->a_vals[i] ); + + if( tmp->a_vals[i] == NULL ) break; } tmp->a_vals[i] = NULL; diff --git a/servers/slapd/value.c b/servers/slapd/value.c index c556493598..6988e6cec6 100644 --- a/servers/slapd/value.c +++ b/servers/slapd/value.c @@ -41,6 +41,7 @@ value_add_fast( for ( i = 0, j = 0; i < naddvals; i++, j++ ) { if ( addvals[i]->bv_len > 0 ) { (*vals)[nvals + j] = ber_bvdup( addvals[i] ); + if( (*vals)[nvals + j] == NULL ) break; } } (*vals)[nvals + j] = NULL; @@ -72,7 +73,8 @@ value_add( for ( i = 0, j = 0; i < nn; i++ ) { if ( addvals[i]->bv_len > 0 ) { - (*vals)[n + j++] = ber_bvdup( addvals[i] ); + (*vals)[n + j] = ber_bvdup( addvals[i] ); + if( (*vals)[n + j++] == NULL ) break; } } (*vals)[n + j] = NULL;