--- dmalloc.c 2012-03-10 23:20:15.446891580 +0530 +++ dmalloc1.c 2012-03-10 23:36:01.766906627 +0530 @@ -296,7 +296,7 @@ static pthread_key_t thread_malloc_key; static pthread_once_t thread_malloc_once = PTHREAD_ONCE_INIT; static struct slglobaldata sldepots[NDEPOTS]; - +static int malloc_init_flag = 0; static int opt_madvise = 0; static int opt_free = 0; static int opt_cache = 4; @@ -353,7 +353,10 @@ malloc_init(void) { const char *p = NULL; - + + if (malloc_init_flag == 1) + return; + Regions[0].mask = -1; /* disallow activity in lowest region */ if (issetugid() == 0) @@ -399,6 +402,7 @@ UTRACE((void *) -1, 0, NULL); _nmalloc_thr_init(); + malloc_init_flag = 1; } /*