mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-02 04:59:39 -05:00
Plug leaks. (benign. slap_controls and root_dse need a destroy() still,
also still need to clear mr's from the ad_map.)
This commit is contained in:
parent
c34c42dec3
commit
9ccecd3907
2 changed files with 16 additions and 7 deletions
|
|
@ -84,6 +84,7 @@ mr_destroy( void )
|
|||
m = LDAP_SLIST_FIRST(&mr_list);
|
||||
LDAP_SLIST_REMOVE_HEAD(&mr_list, smr_next);
|
||||
ch_free( m->smr_str.bv_val );
|
||||
ch_free( m->smr_compat_syntaxes );
|
||||
ldap_matchingrule_free((LDAPMatchingRule *)m);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -298,6 +298,7 @@ int read_root_dse_file( const char *fname )
|
|||
Debug( LDAP_DEBUG_ANY,
|
||||
"read_root_dse_file: SLAP_CALLOC failed", 0, 0, 0 );
|
||||
#endif
|
||||
fclose( fp );
|
||||
return LDAP_OTHER;
|
||||
}
|
||||
usr_attr->e_attrs = NULL;
|
||||
|
|
@ -309,9 +310,8 @@ int read_root_dse_file( const char *fname )
|
|||
if( e == NULL ) {
|
||||
fprintf( stderr, "root_dse: could not parse entry (line=%d)\n",
|
||||
lineno );
|
||||
entry_free( usr_attr );
|
||||
usr_attr = NULL;
|
||||
return EXIT_FAILURE;
|
||||
rc = EXIT_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* make sure the DN is the empty DN */
|
||||
|
|
@ -320,9 +320,8 @@ int read_root_dse_file( const char *fname )
|
|||
"root_dse: invalid rootDSE - dn=\"%s\" (line=%d)\n",
|
||||
e->e_dn, lineno );
|
||||
entry_free( e );
|
||||
entry_free( usr_attr );
|
||||
usr_attr = NULL;
|
||||
return EXIT_FAILURE;
|
||||
rc = EXIT_FAILURE;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -338,15 +337,24 @@ int read_root_dse_file( const char *fname )
|
|||
if( attr_merge( usr_attr, a->a_desc, a->a_vals ) )
|
||||
#endif
|
||||
{
|
||||
return LDAP_OTHER;
|
||||
rc = LDAP_OTHER;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
entry_free( e );
|
||||
if (rc) break;
|
||||
}
|
||||
|
||||
if (rc) {
|
||||
entry_free( usr_attr );
|
||||
usr_attr = NULL;
|
||||
}
|
||||
|
||||
ch_free( buf );
|
||||
|
||||
fclose( fp );
|
||||
|
||||
Debug(LDAP_DEBUG_CONFIG, "rootDSE file %s read.\n", fname, 0, 0);
|
||||
return rc;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue