/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2004 The OpenLDAP Foundation.
+ * Copyright 1998-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
void
attr_free( Attribute *a )
{
- if ( a->a_nvals && a->a_nvals != a->a_vals )
+ if ( a->a_nvals && a->a_nvals != a->a_vals ) {
ber_bvarray_free( a->a_nvals );
+ }
ber_bvarray_free( a->a_vals );
free( a );
}
+#ifdef LDAP_COMP_MATCH
+void
+comp_tree_free( Attribute *a )
+{
+ Attribute *next;
+
+ for( ; a != NULL ; a = next ) {
+ next = a->a_next;
+ if ( component_destructor && a->a_comp_data ) {
+ if ( a->a_comp_data->cd_mem_op )
+ component_destructor( a->a_comp_data->cd_mem_op );
+ free ( a->a_comp_data );
+ }
+ }
+}
+#endif
+
void
attrs_free( Attribute *a )
{
tmp->a_desc = a->a_desc;
tmp->a_next = NULL;
tmp->a_flags = 0;
+#ifdef LDAP_COMP_MATCH
+ tmp->a_comp_data = NULL;
+#endif
return tmp;
}
(*a)->a_nvals = NULL;
(*a)->a_next = NULL;
(*a)->a_flags = 0;
+#ifdef LDAP_COMP_MATCH
+ (*a)->a_comp_data = NULL;
+#endif
}
rc = value_add( &(*a)->a_vals, vals );
(*a)->a_nvals = NULL;
(*a)->a_next = NULL;
(*a)->a_flags = 0;
+#ifdef LDAP_COMP_MATCH
+ (*a)->a_comp_data = NULL;
+#endif
}
rc = value_add_one( &(*a)->a_vals, val );