/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2005 The OpenLDAP Foundation.
+ * Copyright 1998-2006 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
ldap_memfree(air);
- if ( rc ) {
+ while ( names > sat->sat_names ) {
struct aindexrec tmpair;
- while ( names > sat->sat_names ) {
- names--;
- ber_str2bv( *names, 0, 0, &tmpair.air_name );
- tmpair.air_at = sat;
- air = avl_delete( &attr_index,
- (caddr_t)&tmpair, attr_index_cmp );
- assert( air != NULL );
- ldap_memfree( air );
- }
-
- if ( sat->sat_oid ) {
- ber_str2bv( sat->sat_oid, 0, 0, &tmpair.air_name );
- tmpair.air_at = sat;
- air = avl_delete( &attr_index,
- (caddr_t)&tmpair, attr_index_cmp );
- assert( air != NULL );
- ldap_memfree( air );
- }
+ names--;
+ ber_str2bv( *names, 0, 0, &tmpair.air_name );
+ tmpair.air_at = sat;
+ air = (struct aindexrec *)avl_delete( &attr_index,
+ (caddr_t)&tmpair, attr_index_cmp );
+ assert( air != NULL );
+ ldap_memfree( air );
+ }
+
+ if ( sat->sat_oid ) {
+ struct aindexrec tmpair;
+
+ ber_str2bv( sat->sat_oid, 0, 0, &tmpair.air_name );
+ tmpair.air_at = sat;
+ air = (struct aindexrec *)avl_delete( &attr_index,
+ (caddr_t)&tmpair, attr_index_cmp );
+ assert( air != NULL );
+ ldap_memfree( air );
}
return rc;
char *cname = NULL;
char *oidm = NULL;
+ if ( !at->at_oid ) {
+ *err = "";
+ return SLAP_SCHERR_ATTR_INCOMPLETE;
+ }
+
if ( !OID_LEADCHAR( at->at_oid[0] )) {
char *oid;
cname = at->at_names[0];
- } else if ( at->at_oid ) {
+ } else {
cname = at->at_oid;
- } else {
- *err = "";
- code = SLAP_SCHERR_ATTR_INCOMPLETE;
- goto error_return;
}
*err = cname;