From 392bff4abf6b177d0770bcb26e43ae5d7addd7c9 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 4 Jan 2020 21:40:49 +0100 Subject: curl: properly free mimepost data ... as it could otherwise leak memory when a transfer failed. Added test 1293 to verify. Reported-by: Brian Carpenter Fixes #4781 Closes #4782 --- tests/data/Makefile.inc | 4 +-- tests/data/test1293 | 67 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 tests/data/test1293 (limited to 'tests') diff --git a/tests/data/Makefile.inc b/tests/data/Makefile.inc index 5e93b089d..edfa61b0e 100644 --- a/tests/data/Makefile.inc +++ b/tests/data/Makefile.inc @@ -5,7 +5,7 @@ # | (__| |_| | _ <| |___ # \___|\___/|_| \_\_____| # -# Copyright (C) 1998 - 2019, Daniel Stenberg, , et al. +# Copyright (C) 1998 - 2020, Daniel Stenberg, , et al. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms @@ -146,7 +146,7 @@ test1260 test1261 test1262 test1263 test1264 test1265 test1266 test1267 \ test1268 test1269 test1270 \ \ test1280 test1281 test1282 test1283 test1284 test1285 test1286 test1287 \ -test1288 test1289 test1290 test1291 test1292 \ +test1288 test1289 test1290 test1291 test1292 test1293 \ test1298 test1299 \ test1300 test1301 test1302 test1303 test1304 test1305 test1306 test1307 \ test1308 test1309 test1310 test1311 test1312 test1313 test1314 test1315 \ diff --git a/tests/data/test1293 b/tests/data/test1293 new file mode 100644 index 000000000..11a28a326 --- /dev/null +++ b/tests/data/test1293 @@ -0,0 +1,67 @@ + + + +HTTP +HTTP GET +-F + + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Last-Modified: Tue, 13 Jun 2000 12:10:00 GMT +ETag: "21025-dc7-39462498" +Accept-Ranges: bytes +Content-Length: 6 +Connection: close +Content-Type: text/html +Funny-head: yesyes + +-foo- + + + +# +# Client-side + + +http + + +Multipart formpost to two URLs, the first failing + + +http://0 http://%HOSTIP:%HTTPPORT/1293 -F= + + + +# +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +s/^--------------------------[a-z0-9]*/------------------------------/ +s/boundary=------------------------[a-z0-9]*/boundary=----------------------------/ + + +POST /1293 HTTP/1.1 +Host: 127.0.0.1:8990 +Accept: */* +Content-Length: 126 +Content-Type: multipart/form-data; boundary=---------------------------- + +------------------------------ +Content-Disposition: form-data + + +-------------------------------- + + + -- cgit v1.2.3