]> git.sur5r.net Git - openldap/commitdiff
More CSRI malloc debugging support and destroy sockbuf fix.
authorKurt Zeilenga <kurt@openldap.org>
Thu, 19 Aug 1999 18:48:17 +0000 (18:48 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Thu, 19 Aug 1999 18:48:17 +0000 (18:48 +0000)
Test008 now runs without leak.

libraries/liblber/lber-int.h
libraries/libldif/line64.c
servers/slapd/connection.c
tests/Makefile.in

index b65553571df8f32541862fdeb2ced0f8f654a045..c1a8675eba89af57fb34be9590e3b1aea08598dd 100644 (file)
@@ -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 */
 
index 49c884b4e2d5122612520fd3dde621093d5a11a5..cd84e3d26b9719d93ba7b02968774f6421981226 100644 (file)
@@ -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+/";
 
index a1ed6defb791c7f1c60f4c7d8338b39a60381263..4a23bb56bda55baae3448d16355192ced4fddfce 100644 (file)
@@ -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 );
index ef60166ac71f3177af0b29d2731f2b74b773babf..4a66102e7d41d348de1119610cb62620c50c78e9 100644 (file)
@@ -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