aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-02-28 12:35:09 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-02-28 12:35:09 +0000
commit907dabed5df37dc52011afc8616ab4d7162cb37e (patch)
treea6fb0f484738bbf30e0d455231d26b1dbdc61e77
parent0cacbc892cb73b3903805541470d7826094d934e (diff)
memory debugging is now only enabled if the CURL_MEMDEBUG environment
variable is set when curl is invoked
-rw-r--r--src/main.c11
1 files changed, 8 insertions, 3 deletions
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;