Commit 9e82379b authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

More CSRI malloc debugging support and destroy sockbuf fix.

Test008 now runs without leak.
parent e290eacb
......@@ -211,6 +211,22 @@ ber_log_sos_dump LDAP_P((
/* simple macros to realloc for now */
extern BerMemoryFunctions* ber_int_memory_fns;
#ifdef CSRIMALLOC
#define LBER_INT_MALLOC malloc
#define LBER_INT_CALLOC calloc
#define LBER_INT_REALLOC realloc
#define LBER_INT_FREE free
#define LBER_INT_VFREE ber_memvfree
#define LBER_INT_STRDUP strdup
#define LBER_MALLOC malloc
#define LBER_CALLOC calloc
#define LBER_REALLOC realloc
#define LBER_FREE free
#define LBER_VFREE ber_memvfree
#define LBER_STRDUP strdup
#else
#define LBER_INT_MALLOC(s) ber_memalloc((s))
#define LBER_INT_CALLOC(n,s) ber_memcalloc((n),(s))
#define LBER_INT_REALLOC(p,s) ber_memrealloc((p),(s))
......@@ -224,6 +240,7 @@ extern BerMemoryFunctions* ber_int_memory_fns;
#define LBER_FREE(p) ber_memfree((p))
#define LBER_VFREE(v) ber_memvfree((void**)(v))
#define LBER_STRDUP(s) ber_strdup((s))
#endif
/* sockbuf.c */
......
......@@ -25,6 +25,13 @@ int ldif_debug = 0;
#define RIGHT4 0x0f
#define CONTINUED_LINE_MARKER '\001'
#ifdef CSRIMALLOC
#define ber_memalloc malloc
#define ber_memcalloc calloc
#define ber_memrealloc realloc
#define ber_strdup strdup
#endif
static const char nib2b64[0x40] =
"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
......
......@@ -115,6 +115,7 @@ int connections_destroy(void)
for ( i = 0; i < dtblsize; i++ ) {
if( connections[i].c_struct_state != SLAP_C_UNINITIALIZED ) {
ber_sockbuf_free( connections[i].c_sb );
ldap_pvt_thread_mutex_destroy( &connections[i].c_mutex );
ldap_pvt_thread_mutex_destroy( &connections[i].c_write_mutex );
ldap_pvt_thread_cond_destroy( &connections[i].c_write_cv );
......
......@@ -53,7 +53,7 @@ test-nis-schema-bdb2:
fi
clean-local: FORCE
-$(RM) test-db/[!C]* test-repl/[!C]* *gmon *core
-$(RM) test-db/[!C]* test-repl/[!C]* *leak *gmon *core
veryclean-local: FORCE
@-$(RM) data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment