]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/at.c
add new ber dump routine (behind NEW_LOGGING)
[openldap] / servers / slapd / at.c
index 5c08f723fbc822df4bf3dd6e92d21bee0d4171c9..25c1d7589bfa895a3d5709bd0d10c8ecb71c7eed 100644 (file)
@@ -74,23 +74,12 @@ at_find(
     const char         *name
 )
 {
-       struct aindexrec        *air;
-       char                    *tmpname;
-
-       {
-               tmpname = (char *)name;
-       }
+       struct aindexrec *air;
 
-       if ( (air = (struct aindexrec *) avl_find( attr_index, tmpname,
-            (AVL_CMP) attr_index_name_cmp )) != NULL ) {
-               if ( tmpname != name )
-                       ldap_memfree( tmpname );
-               return( air->air_at );
-       }
+       air = (struct aindexrec *) avl_find( attr_index, name,
+            (AVL_CMP) attr_index_name_cmp );
 
-       if ( tmpname != name )
-               ldap_memfree( tmpname );
-       return( NULL );
+       return air != NULL ? air->air_at : NULL;
 }
 
 int
@@ -258,7 +247,7 @@ at_add(
                return SLAP_SCHERR_ATTR_INCOMPLETE;
        }
        sat = (AttributeType *) ch_calloc( 1, sizeof(AttributeType) );
-       memcpy( &sat->sat_atype, at, sizeof(LDAPAttributeType));
+       AC_MEMCPY( &sat->sat_atype, at, sizeof(LDAPAttributeType));
 
        sat->sat_cname = cname;