Plugged other small leaks.
backendDB[i].bd_info->bi_db_destroy(
&backendDB[i] );
}
+ charray_free( backendDB[i].be_suffix );
+ ber_bvecfree( backendDB[i].be_nsuffix );
+ free( backendDB[i].be_root_dn );
+ free( backendDB[i].be_root_ndn );
+ free( backendDB[i].be_root_pw.bv_val );
}
+ free( backendDB );
/* destroy each backend type */
for( i = 0; i < nBackendInfo; i++ ) {
#endif
} else {
- char *dn = ch_strdup( cargv[1] );
+ char *dn;
if ( load_ucdata( NULL ) < 0 ) {
return( 1 );
}
+ dn = ch_strdup( cargv[1] );
if( dn_validate( dn ) == NULL ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "config", LDAP_LEVEL_CRIT,
"suffix DN invalid \"%s\"\n",
fname, lineno, cargv[1] );
#endif
-
+ free( dn );
return 1;
} else if( *dn == '\0' && default_search_nbase != NULL ) {
"unable to normalize suffix "
"\"%s\"\n", dn, NULL, NULL );
#endif
+ free( dn );
return 1;
}
#endif /* USE_LDAP_DN_PARSING */
loaded = 1;
return( 1 );
}
+
+void
+config_destroy( )
+{
+ ucdata_unload( UCDATA_ALL );
+ free( line );
+ if ( slapd_args_file )
+ free ( slapd_args_file );
+ if ( slapd_pid_file )
+ free ( slapd_pid_file );
+}
}
#endif /* LDAP_PF_LOCAL */
slapd_close( slap_listeners[l]->sl_sd );
- break;
}
+ if ( slap_listeners[l]->sl_url )
+ free ( slap_listeners[l]->sl_url );
+ if ( slap_listeners[l]->sl_name )
+ free ( slap_listeners[l]->sl_name );
+ free ( slap_listeners[l] );
}
+ free ( slap_listeners );
+ slap_listeners = NULL;
#ifdef NEW_LOGGING
LDAP_LOG(( "connection", LDAP_LEVEL_CRIT,
if( serverName == NULL ) {
if ( (serverName = strrchr( argv[0], *LDAP_DIRSEP )) == NULL ) {
- serverName = ch_strdup( argv[0] );
+ serverName = argv[0];
} else {
- serverName = ch_strdup( serverName + 1 );
+ serverName = serverName + 1;
}
}
ldap_pvt_tls_destroy();
#endif
+ config_destroy();
+
#ifdef CSRIMALLOC
mal_dumpleaktrace( leakfile );
#endif
#ifdef HAVE_CYRUS_SASL
sasl_done();
#endif
+ free( global_host );
+ global_host = NULL;
+
return 0;
}