From 387186fc339338fe9c2c5f674a73db071711c848 Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 20 Aug 1999 22:59:00 +0000 Subject: [PATCH] Stop mergers if dup returns NULL. --- servers/slapd/attr.c | 2 ++ servers/slapd/value.c | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) 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; -- 2.39.5