aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/main.c3
-rwxr-xr-xtests/runtests.pl4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 14f34fac1..12ff3db91 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2933,8 +2933,9 @@ operate(struct Configurable *config, int argc, char *argv[])
/* this sends all memory debug messages to a logfile named memdump */
env = curlx_getenv("CURL_MEMDEBUG");
if(env) {
+ /* use the value as file name */
+ curl_memdebug(env);
curl_free(env);
- curl_memdebug("memdump");
}
env = curlx_getenv("CURL_MEMLIMIT");
if(env) {
diff --git a/tests/runtests.pl b/tests/runtests.pl
index 90e247293..e26da06c9 100755
--- a/tests/runtests.pl
+++ b/tests/runtests.pl
@@ -78,7 +78,7 @@ my $perl="perl -I$srcdir";
my $curl_debug=0;
# name of the file that the memory debugging creates:
-my $memdump="memdump";
+my $memdump="$LOGDIR/memdump";
# the path to the script that analyzes the memory debug output file:
my $memanalyze="./memanalyze.pl";
@@ -135,7 +135,7 @@ my $tortalloc;
chomp($pwd = `pwd`);
# enable memory debugging if curl is compiled with it
-$ENV{'CURL_MEMDEBUG'} = 1;
+$ENV{'CURL_MEMDEBUG'} = $memdump;
$ENV{'HOME'}=$pwd;
##########################################################################