]> git.sur5r.net Git - openldap/commitdiff
Stop mergers if dup returns NULL.
authorKurt Zeilenga <kurt@openldap.org>
Fri, 20 Aug 1999 22:59:00 +0000 (22:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 20 Aug 1999 22:59:00 +0000 (22:59 +0000)
servers/slapd/attr.c
servers/slapd/value.c

index 2aadf7056c9559b364ed98218c5534ffe6dbc57a..9bde8bc6b76c2bb75d00a3918a85bc6cbace1530 100644 (file)
@@ -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;
index c5564935984c3f9804b92bb37bf6964a09ee6600..6988e6cec6860f4e705a85f7c94bd9f94d981521 100644 (file)
@@ -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;