From 613719687c29d6112bc30d275ac827db9b025bdf Mon Sep 17 00:00:00 2001 From: hniksic Date: Sat, 18 Jun 2005 07:13:16 -0700 Subject: [PATCH] [svn] Fix broken --save-headers. --- src/ChangeLog | 5 +++++ src/http.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index 756178e7..2b62712d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2005-06-18 Hrvoje Niksic + + * http.c (gethttp): Don't free "head" before using it to save + headers. + 2005-06-18 Hrvoje Niksic * http.c (gethttp): When -E is in use, check for file existence diff --git a/src/http.c b/src/http.c index 263a26fd..69760e7a 100644 --- a/src/http.c +++ b/src/http.c @@ -1753,7 +1753,6 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy) contrange = first_byte_pos; } resp_free (resp); - xfree (head); /* 20x responses are counted among successful by default. */ if (H_20X (statcode)) @@ -1946,6 +1945,9 @@ gethttp (struct url *u, struct http_stat *hs, int *dt, struct url *proxy) if (opt.save_headers) fwrite (head, 1, strlen (head), fp); + /* Now we no longer need to store the response header. */ + xfree (head); + /* Download the request body. */ flags = 0; if (keep_alive) -- 2.39.2