]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/attr.c
cleanup bind
[openldap] / servers / slapd / attr.c
index d72c5ae092643218744f7d71b60ae25536ee9c6f..d98ec3cefed171fe50df5985ac62032d92d8078b 100644 (file)
 #include "ldap_pvt.h"
 #include "slap.h"
 
-#ifdef LDAP_DEBUG
-static void at_index_print( void ) 
-{
-}
-#endif
-
 void
 attr_free( Attribute *a )
 {
@@ -65,30 +59,23 @@ Attribute *attr_dup( Attribute *a )
                }
 
                tmp->a_vals = ch_malloc((i+1) * sizeof(struct berval));
-#ifdef SLAP_NVALUES
-               if( a->a_nvals != NULL ) {
-                       tmp->a_nvals = ch_malloc((i+1) * sizeof(struct berval));
-               }
-#endif
-
                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;
+               }
+               tmp->a_vals[i].bv_val = NULL;
 
 #ifdef SLAP_NVALUES
-                       if( a->a_nvals ) {
+               if( a->a_nvals != NULL ) {
+                       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;
-                       } else {
-                               tmp->a_nvals = NULL;
                        }
-#endif
-               }
-
-               tmp->a_vals[i].bv_val = NULL;
-#ifdef SLAP_NVALUES
-               if( tmp->a_nvals != NULL ) {
                        tmp->a_nvals[i].bv_val = NULL;
+
+               } else {
+                       tmp->a_nvals = NULL;
                }
 #endif
 
@@ -178,7 +165,7 @@ attr_merge_one(
        AttributeDescription *desc,
        struct berval   *val
 #ifdef SLAP_NVALUES
-       , BerVarray     nval
+       , struct berval *nval
 #endif
 ) {
        int rc;