Added oidm_destroy

This commit is contained in:
Howard Chu 2001-12-31 04:35:02 +00:00
parent 10961151ef
commit e6d4c7dbcc
3 changed files with 17 additions and 2 deletions

View File

@ -718,6 +718,7 @@ LDAP_SLAPD_F (int) syn_schema_info( Entry *e );
*/
LDAP_SLAPD_F (void) oc_destroy LDAP_P(( void ));
LDAP_SLAPD_F (void) oidm_destroy LDAP_P(( void ));
LDAP_SLAPD_F (void) at_destroy LDAP_P(( void ));
LDAP_SLAPD_F (void) ad_destroy LDAP_P(( void * ));
LDAP_SLAPD_F (void) mr_destroy LDAP_P(( void ));

View File

@ -4647,6 +4647,7 @@ schema_init( void )
void
schema_destroy( void )
{
oidm_destroy();
oc_destroy();
at_destroy();
mr_destroy();

View File

@ -116,8 +116,8 @@ find_oidm(char *oid)
if( pos ) {
int suflen = strlen(oid + pos);
char *new = ch_calloc(1,
om->som_oid.bv_len + suflen + 1);
char *new = ch_malloc( om->som_oid.bv_len
+ suflen + 1);
strcpy(new, om->som_oid.bv_val);
if( suflen ) {
@ -132,6 +132,19 @@ find_oidm(char *oid)
return NULL;
}
void
oidm_destroy()
{
OidMacro *om, *n;
for (om = om_list; om; om = n) {
n = om->som_next;
charray_free(om->som_names);
free(om->som_oid.bv_val);
free(om);
}
}
int
parse_oidm(
const char *fname,