From: Daniel Stenberg Date: Thu, 27 Jan 2005 22:40:56 +0000 (+0000) Subject: Use the same work-around for the memdebug stuff as in the command line client, X-Git-Tag: curl-7_13_0~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aacc79a3a3d323a6462a765deb5be5a27c60601f;p=thirdparty%2Fcurl.git 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. --- diff --git a/tests/libtest/first.c b/tests/libtest/first.c index c4f35df22d..a7f3173557 100644 --- a/tests/libtest/first.c +++ b/tests/libtest/first.c @@ -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");