1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

Use the same work-around for the memdebug stuff as in the command line client,

to allow the contents of the env var decide the file name.
This commit is contained in:
Daniel Stenberg 2005-01-27 22:40:56 +00:00
parent 9864bf703d
commit aacc79a3a3

View File

@ -19,8 +19,14 @@ int main(int argc, char **argv)
/* this sends all memory debug messages to a logfile named memdump */
char *env = curl_getenv("CURL_MEMDEBUG");
if(env) {
/* use the value as file name */
char *s = strdup(env);
curl_free(env);
curl_memdebug("memdump");
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! */
}
/* this enables the fail-on-alloc-number-N functionality */
env = curl_getenv("CURL_MEMLIMIT");