X-Git-Url: http://sjero.net/git/?a=blobdiff_plain;f=src%2Fhttp.c;h=fc88118fa773acff6ce05d459f6eecb8b77aa6dc;hb=9fab5a9f287ef43e3ef28a0de72862c90f47241d;hp=247ba6748096f56153d4922a23a4314552529bb0;hpb=1d9bb1c7b05d877f7dc2f8b537feada3f2c373a3;p=wget diff --git a/src/http.c b/src/http.c index 247ba674..fc88118f 100644 --- a/src/http.c +++ b/src/http.c @@ -1986,12 +1986,14 @@ read_header: _("Malformed status line"))); CLOSE_INVALIDATE (sock); request_free (req); + xfree (head); return HERR; } if (H_10X (statcode)) { DEBUGP (("Ignoring response\n")); + xfree (head); goto read_header; } @@ -2040,8 +2042,9 @@ read_header: } } - resp_header_copy (resp, "Transfer-Encoding", hdrval, sizeof (hdrval)); - if (0 == strcasecmp (hdrval, "chunked")) + chunked_transfer_encoding = false; + if (resp_header_copy (resp, "Transfer-Encoding", hdrval, sizeof (hdrval)) + && 0 == strcasecmp (hdrval, "chunked")) chunked_transfer_encoding = true; /* Handle (possibly multiple instances of) the Set-Cookie header. */