From: Daniel Stenberg Date: Thu, 28 Feb 2002 12:35:09 +0000 (+0000) Subject: memory debugging is now only enabled if the CURL_MEMDEBUG environment X-Git-Tag: curl-7_9_5~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=907dabed5df37dc52011afc8616ab4d7162cb37e;p=curl memory debugging is now only enabled if the CURL_MEMDEBUG environment variable is set when curl is invoked --- diff --git a/src/main.c b/src/main.c index 3cfd4a9b5..caf02e7cc 100644 --- a/src/main.c +++ b/src/main.c @@ -1890,13 +1890,18 @@ operate(struct Configurable *config, int argc, char *argv[]) int res = 0; int i; - errorbuffer[0]=0; /* prevent junk from being output */ - #ifdef MALLOCDEBUG /* this sends all memory debug messages to a logfile named memdump */ - curl_memdebug("memdump"); + char *env; + env = curl_getenv("CURL_MEMDEBUG"); + if(env) { + free(env); + curl_memdebug("memdump"); + } #endif + errorbuffer[0]=0; /* prevent junk from being output */ + main_init(); /* inits */ config->showerror=TRUE;