mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-28 17:47:33 -05:00
more cleanup
This commit is contained in:
parent
0f18805d65
commit
551dab0d03
2 changed files with 22 additions and 5 deletions
|
|
@ -730,6 +730,11 @@ error_return:;
|
|||
ch_free( sat );
|
||||
}
|
||||
|
||||
if ( oidm ) {
|
||||
SLAP_FREE( at->at_oid );
|
||||
at->at_oid = oidm;
|
||||
}
|
||||
|
||||
} else if ( rsat ) {
|
||||
*rsat = sat;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -417,6 +417,8 @@ init_config_attrs(ConfigTable *ct) {
|
|||
const char *err;
|
||||
|
||||
for (i=0; ct[i].name; i++ ) {
|
||||
int freeit = 0;
|
||||
|
||||
if ( !ct[i].attribute ) continue;
|
||||
at = ldap_str2attributetype( ct[i].attribute,
|
||||
&code, &err, LDAP_SCHEMA_ALLOW_ALL );
|
||||
|
|
@ -425,19 +427,29 @@ init_config_attrs(ConfigTable *ct) {
|
|||
ct[i].attribute, ldap_scherr2str(code), err );
|
||||
return code;
|
||||
}
|
||||
|
||||
code = at_add( at, 0, NULL, &err );
|
||||
if ( code && code != SLAP_SCHERR_ATTR_DUP ) {
|
||||
fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s, %s\n",
|
||||
ct[i].attribute, scherr2str(code), err );
|
||||
return code;
|
||||
if ( code ) {
|
||||
if ( code == SLAP_SCHERR_ATTR_DUP ) {
|
||||
freeit = 1;
|
||||
|
||||
} else {
|
||||
fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s, %s\n",
|
||||
ct[i].attribute, scherr2str(code), err );
|
||||
return code;
|
||||
}
|
||||
}
|
||||
code = slap_str2ad( at->at_names[0], &ct[i].ad, &err );
|
||||
if ( freeit ) {
|
||||
ldap_attributetype_free( at );
|
||||
} else {
|
||||
ldap_memfree( at );
|
||||
}
|
||||
if ( code ) {
|
||||
fprintf( stderr, "init_config_attrs: AttributeType \"%s\": %s\n",
|
||||
ct[i].attribute, err );
|
||||
return code;
|
||||
}
|
||||
ldap_memfree( at );
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue