#include "slap.h"
+#ifdef LDAP_COMP_MATCH
+extern free_component_func* component_destructor;
+#endif
void
attr_free( Attribute *a )
{
if ( a->a_nvals && a->a_nvals != a->a_vals )
ber_bvarray_free( a->a_nvals );
ber_bvarray_free( a->a_vals );
+#ifdef LDAP_COMP_MATCH
+ if ( component_destructor && a->a_comp_data && a->a_comp_data->cd_mem_op ) {
+ component_destructor( a->a_comp_data->cd_mem_op );
+ free ( a->a_comp_data );
+ }
+#endif
free( 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 );