summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2005-01-27 22:40:56 +0000
committerDaniel Stenberg <daniel@haxx.se>2005-01-27 22:40:56 +0000
commitaacc79a3a3d323a6462a765deb5be5a27c60601f (patch)
treeecb8139d53f51e19ae1d396e3e7143804b2b8d21
parent9864bf703d8f1da018c51d2b3734977c2c0a5795 (diff)
downloadgnurl-aacc79a3a3d323a6462a765deb5be5a27c60601f.tar.gz
gnurl-aacc79a3a3d323a6462a765deb5be5a27c60601f.tar.bz2
gnurl-aacc79a3a3d323a6462a765deb5be5a27c60601f.zip
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.
-rw-r--r--tests/libtest/first.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/libtest/first.c b/tests/libtest/first.c
index c4f35df22..a7f317355 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");