improve previous commit; same fix required by objectClasses (ITS#4185)

This commit is contained in:
Pierangelo Masarati 2005-11-19 00:33:19 +00:00
parent 4d3fe81780
commit 5d83746abf
2 changed files with 42 additions and 18 deletions

View File

@ -394,27 +394,27 @@ at_insert(
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 );
}
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 ) {
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 );
}
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;

View File

@ -524,6 +524,30 @@ oc_insert(
rc = oc_check_dup( old_soc, soc );
ldap_memfree( oir );
while ( names > soc->soc_names ) {
struct oindexrec tmpoir;
names--;
ber_str2bv( *names, 0, 0, &tmpoir.oir_name );
tmpoir.oir_oc = soc;
oir = (struct oindexrec *)avl_delete( &oc_index,
(caddr_t)&tmpoir, oc_index_cmp );
assert( oir != NULL );
ldap_memfree( oir );
}
if ( soc->soc_oid ) {
struct oindexrec tmpoir;
ber_str2bv( soc->soc_oid, 0, 0, &tmpoir.oir_name );
tmpoir.oir_oc = soc;
oir = (struct oindexrec *)avl_delete( &oc_index,
(caddr_t)&tmpoir, oc_index_cmp );
assert( oir != NULL );
ldap_memfree( oir );
}
return rc;
}