char *ldiffile = NULL;
FILE *ldiffp = NULL;
+#ifdef CSRIMALLOC
+ char *leakfilename;
+ FILE *leakfile;
+#endif
+
Backend *be = NULL;
static void
progname = lutil_progname( name, argc, argv );
+#ifdef CSRIMALLOC
+ leakfilename = malloc( strlen( progname ) + sizeof(".leak") );
+ sprintf( leakfilename, "%s.leak", progname );
+ if( ( leakfile = fopen( leakfilename, "w" )) == NULL ) {
+ leakfile = stderr;
+ }
+ free( leakfilename );
+#endif
+
switch( tool ) {
case SLAPADD:
options = "b:cd:f:l:n:stv";
be = &backends[dbnum];
}
+#ifdef CSRIMALLOC
+ mal_leaktrace(1);
+#endif
+
slap_startup( be );
}
{
slap_shutdown( be );
slap_destroy();
+
+#ifdef CSRIMALLOC
+ mal_dumpleaktrace( leakfile );
+#endif
}