From: Howard Chu Date: Mon, 31 Dec 2001 04:35:02 +0000 (+0000) Subject: Added oidm_destroy X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~400 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e6d4c7dbcc21d38b40ae1fa307f167a9247a9015;p=openldap Added oidm_destroy --- diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index beead593aa..085ba1d7c8 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -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 )); diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index 558a528abf..4759971ccc 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -4647,6 +4647,7 @@ schema_init( void ) void schema_destroy( void ) { + oidm_destroy(); oc_destroy(); at_destroy(); mr_destroy(); diff --git a/servers/slapd/schemaparse.c b/servers/slapd/schemaparse.c index e969e9b390..d9f6b6c106 100644 --- a/servers/slapd/schemaparse.c +++ b/servers/slapd/schemaparse.c @@ -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,