From dbcaa0065719acc0383307f13d02d3d0c9b5c635 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 25 Jan 2011 12:06:50 +0100 Subject: HTTP: memory leak on multiple Location: The HTTP parser allocated memory on each received Location: header without properly freeing old data. Starting now, the code only considers the first Location: header and will blissfully ignore subsequent ones. Bug: http://curl.haxx.se/bug/view.cgi?id=3165129 Reported by: Martin Lemke --- tests/data/test580 | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 tests/data/test580 (limited to 'tests/data/test580') diff --git a/tests/data/test580 b/tests/data/test580 new file mode 100644 index 000000000..8256f0e2e --- /dev/null +++ b/tests/data/test580 @@ -0,0 +1,58 @@ + + + +HTTP +HTTP GET +multi +Duplicate-header + + + +# Server-side + + +HTTP/1.1 302 eat this! +Date: Thu, 09 Nov 2010 14:49:00 GMT +Server: test-server/fake +Location: this-is-the-first.html +Content-Length: 0 +Connection: close +Location: and there's a second one too! / moo.html + + + + +# Client-side + + +http + + +http + +# tool is what to use instead of 'curl' + +lib507 + + + +multi interface, multiple Location: headers + + +http://%HOSTIP:%HTTPPORT/580 + + + +# Verify data after the test has been "shot" + + +^User-Agent:.* + + +GET /580 HTTP/1.1 +Host: %HOSTIP:%HTTPPORT +Accept: */* + + + + -- cgit v1.2.3