aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-27 15:59:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-27 15:59:01 +0000
commit9864bf703d8f1da018c51d2b3734977c2c0a5795 (patch)
tree85b4d4224aa71105bbb0f60f001c7731afc66ab9 /src
parent289a42f050447ab7d0ec0d9c276e867a37be2430 (diff)
a slightly involved work-around to prevent the debug-tracing from logging
a free-without-alloc as the first call
Diffstat (limited to 'src')
-rw-r--r--src/main.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 12ff3db91..1558d18f2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2934,8 +2934,13 @@ operate(struct Configurable *config, int argc, char *argv[])
env = curlx_getenv("CURL_MEMDEBUG");
if(env) {
/* use the value as file name */
- curl_memdebug(env);
+ char *s = strdup(env);
curl_free(env);
+ curl_memdebug(s);
+ free(s);
+ /* this weird strdup() and stuff here is to make the curl_free() get
+ called before the memdebug() as otherwise the memdebug tracing will
+ with tracing a free() without an alloc! */
}
env = curlx_getenv("CURL_MEMLIMIT");
if(env) {