]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/attr.c
ITS#2919 move OpenLDAPtime to OpenLDAPperson
[openldap] / servers / slapd / attr.c
index e1e64c85662412c0d52a174c627363f6483025d2..ee0f46daabc5d87fc631f06bb2c5f13295a6d49c 100644 (file)
@@ -2,7 +2,7 @@
 /* $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
@@ -43,8 +43,9 @@
 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 );
 }
@@ -57,9 +58,9 @@ comp_tree_free( Attribute *a )
 
        for( ; a != NULL ; a = next ) {
                next = a->a_next;
-               if ( component_destructor && a->a_comp_data &&
-                                       a->a_comp_data->cd_mem_op ) {
-                       component_destructor( a->a_comp_data->cd_mem_op );
+               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 );
                }
        }
@@ -176,7 +177,7 @@ attr_merge(
        Attribute       **a;
 
        for ( a = &e->e_attrs; *a != NULL; a = &(*a)->a_next ) {
-               if ( ad_cmp( (*a)->a_desc, desc ) == 0 ) {
+               if (  (*a)->a_desc == desc ) {
                        break;
                }
        }
@@ -260,7 +261,7 @@ attr_merge_one(
        Attribute       **a;
 
        for ( a = &e->e_attrs; *a != NULL; a = &(*a)->a_next ) {
-               if ( ad_cmp( (*a)->a_desc, desc ) == 0 ) {
+               if ( (*a)->a_desc == desc ) {
                        break;
                }
        }
@@ -352,7 +353,7 @@ attr_find(
        AttributeDescription *desc )
 {
        for ( ; a != NULL; a = a->a_next ) {
-               if ( ad_cmp( a->a_desc, desc ) == 0 ) {
+               if ( a->a_desc == desc ) {
                        return( a );
                }
        }
@@ -375,7 +376,7 @@ attr_delete(
        Attribute       **a;
 
        for ( a = attrs; *a != NULL; a = &(*a)->a_next ) {
-               if ( ad_cmp( (*a)->a_desc, desc ) == 0 ) {
+               if ( (*a)->a_desc == desc ) {
                        Attribute       *save = *a;
                        *a = (*a)->a_next;
                        attr_free( save );