From f009bbe1f625b19236dc2ed57726b2f0f39a27c4 Mon Sep 17 00:00:00 2001 From: Patrick Monnerat Date: Wed, 20 Dec 2017 19:33:50 +0100 Subject: curl_easy_reset: release mime-related data. Move curl_mime_initpart() and curl_mime_cleanpart() calls to lower-level functions dealing with UserDefined structure contents. This avoids memory leakages on curl-generated part mime headers. New test 2073 checks this using the cli tool --next option: it triggers a valgrind error if bug is present. Bug: https://curl.haxx.se/mail/lib-2017-12/0060.html Reported-by: Martin Galvan --- tests/data/test2073 | 68 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 tests/data/test2073 (limited to 'tests/data/test2073') diff --git a/tests/data/test2073 b/tests/data/test2073 new file mode 100644 index 000000000..ed942f018 --- /dev/null +++ b/tests/data/test2073 @@ -0,0 +1,68 @@ + + + +HTTP +HTTP FORMPOST + + +# +# Server-side + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 10 + +contents1 + + +HTTP/1.1 200 OK +Date: Thu, 09 Nov 2010 14:49:00 GMT +Content-Length: 10 + +contents2 + + + +# +# Client-side + + +http + + +HTTP form posts with handle reset + + +http://%HOSTIP:%HTTPPORT/2073 -F 'name=a;filename=a.pdf' --next http://%HOSTIP:%HTTPPORT/2073 -F 'name=b;filename=b.jpg' + + + +# +# Verify data after the test has been "shot" + + +^(User-Agent:|Content-Type: multipart/form-data;|------------).* + + +POST /2073 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 189 + +Content-Disposition: form-data; name="name"; filename="a.pdf" +Content-Type: application/pdf + +a +POST /2073 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* +Content-Length: 184 + +Content-Disposition: form-data; name="name"; filename="b.jpg" +Content-Type: image/jpeg + +b + + + -- cgit v1.2.3