]> git.sur5r.net Git - openldap/commitdiff
Added oidm_destroy
authorHoward Chu <hyc@openldap.org>
Mon, 31 Dec 2001 04:35:02 +0000 (04:35 +0000)
committerHoward Chu <hyc@openldap.org>
Mon, 31 Dec 2001 04:35:02 +0000 (04:35 +0000)
servers/slapd/proto-slap.h
servers/slapd/schema_init.c
servers/slapd/schemaparse.c

index beead593aa06aadd6ffb5f1314b8c5468a369eb4..085ba1d7c87ff9bc0ef1eecf24f66c4bdef8ab17 100644 (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 ));
index 558a528abf7a51015345fb18905c5e4bd7c9742c..4759971ccc8898bd4e6b6c9e25e0582da052b6cd 100644 (file)
@@ -4647,6 +4647,7 @@ schema_init( void )
 void
 schema_destroy( void )
 {
+       oidm_destroy();
        oc_destroy();
        at_destroy();
        mr_destroy();
index e969e9b39066abf64198656555f04247edb8460f..d9f6b6c106e931ea326709ed13ff520ecc979f78 100644 (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,