aboutsummaryrefslogtreecommitdiff
path: root/src/tool_operhlp.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-02-02 13:45:35 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-02-02 13:48:36 +0000
commit0104678c798aabcd1935d736118d87a1358e14ec (patch)
tree274dd1aca2d194e7f19edfef430e4c539555bb6e /src/tool_operhlp.c
parentffb8a21d85bde8b626e5dc52ce25f0447ee49f89 (diff)
tool_operate: Moved memory tracking initialisation into tool_main
Diffstat (limited to 'src/tool_operhlp.c')
-rw-r--r--src/tool_operhlp.c32
1 files changed, 1 insertions, 31 deletions
diff --git a/src/tool_operhlp.c b/src/tool_operhlp.c
index c33ca507d..b8c0a2971 100644
--- a/src/tool_operhlp.c
+++ b/src/tool_operhlp.c
@@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
@@ -219,33 +219,3 @@ void main_free(void)
metalink_cleanup();
}
-#ifdef CURLDEBUG
-void memory_tracking_init(void)
-{
- char *env;
- /* if CURL_MEMDEBUG is set, this starts memory tracking message logging */
- env = curlx_getenv("CURL_MEMDEBUG");
- if(env) {
- /* use the value as file name */
- char fname[CURL_MT_LOGFNAME_BUFSIZE];
- if(strlen(env) >= CURL_MT_LOGFNAME_BUFSIZE)
- env[CURL_MT_LOGFNAME_BUFSIZE-1] = '\0';
- strcpy(fname, env);
- curl_free(env);
- curl_memdebug(fname);
- /* this weird stuff here is to make curl_free() get called
- before curl_memdebug() as otherwise memory tracking will
- log a free() without an alloc! */
- }
- /* if CURL_MEMLIMIT is set, this enables fail-on-alloc-number-N feature */
- env = curlx_getenv("CURL_MEMLIMIT");
- if(env) {
- char *endptr;
- long num = strtol(env, &endptr, 10);
- if((endptr != env) && (endptr == env + strlen(env)) && (num > 0))
- curl_memlimit(num);
- curl_free(env);
- }
-}
-#endif
-