diff --git a/src/tool_operate.c b/src/tool_operate.c
index 07766f3c7b..01c46909a0 100644
--- a/src/tool_operate.c
+++ b/src/tool_operate.c
@@ -2140,6 +2140,7 @@ static CURLcode single_transfer(struct GlobalConfig *global,
     }
     break;
   }
+  Curl_safefree(state->outfiles);
 
   if(!*added || result) {
     *added = FALSE;
diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc
index d849c3b1a7..07bdf6ac49 100644
--- a/tests/data/Makefile.inc
+++ b/tests/data/Makefile.inc
@@ -64,7 +64,7 @@ test361 test362 test363 test364 test365 test366 test367 test368 test369 \
 test370 test371 test372 test373 test374 test375 test376 test378 test379 \
 test380 test381 test383 test384 test385 test386 \
 \
-test391 test392 test393 test394 test395 test396 test397 test398 \
+test390 test391 test392 test393 test394 test395 test396 test397 test398 \
 \
 test400 test401 test402 test403 test404 test405 test406 test407 test408 \
 test409 test410 test411 test412 test413 test414 \
diff --git a/tests/data/test390 b/tests/data/test390
new file mode 100644
index 0000000000..80e8c2b708
--- /dev/null
+++ b/tests/data/test390
@@ -0,0 +1,48 @@
+<testcase>
+<info>
+<keywords>
+HTTP
+FTP
+parallel
+</keywords>
+</info>
+
+#
+# Server-side
+<reply>
+<data nocheck="yes">
+HTTP/1.1 200 OK
+Content-Length: 10001
+Content-Type: text/html
+
+%repeat[1000 x hellohttp!]%
+</data>
+
+<data2 nocheck="yes">
+%repeat[1000 x hello ftp!]%
+</data2>
+
+</reply>
+
+#
+# Client-side
+<client>
+<file name="log/test%TESTNUMBER.txt">
+%repeat[1000 x hellofile!]%
+</file>
+<server>
+http
+ftp
+</server>
+<name>
+curl HTTP, FILE and FTP in parallel
+</name>
+<command option="no-output">
+http://%HOSTIP:%HTTPPORT/%TESTNUMBER file://localhost%FILE_PWD/log/test%TESTNUMBER.txt ftp://%HOSTIP:%FTPPORT/%TESTNUMBER0002 --parallel -o log/%TESTNUMBER.a -o log/%TESTNUMBER.b -o log/%TESTNUMBER.c
+</command>
+</client>
+
+#
+<verify>
+</verify>
+</testcase>