]> sjero.net Git - wget/commitdiff
Fix a memory leak.
authorGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 18 Aug 2011 13:17:20 +0000 (15:17 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Thu, 18 Aug 2011 13:17:20 +0000 (15:17 +0200)
src/ChangeLog
src/http.c

index 7389d059923620cdb5cfc97173a32138b6bde9b4..b4420ccd6c2f71d071a089b450d6b47fc425b57d 100644 (file)
@@ -1,10 +1,11 @@
-2011-08-18  Giuseppe Scrivano  <gscrivano@gnu.org>
+2011-08-18  Giuseppe Scrivano  <giuseppe@southpole.se>
+
+       * http.c (gethttp): Fix a memory leak on some errors.  Free the head
+       buffer.
 
        * Makefile.am: Use an additional file "css_.c" which in turn includes
        "wget.h" and immediately "css.c".
 
-2011-08-18  Giuseppe Scrivano  <giuseppe@southpole.se>
-
        * http.c (gethttp): Reset chunked_transfer_encoding on redirections.
        Reported by: Axel Reinhold <axel@freakout.de>.
 
index b7026cd8fa9f44bf4adb5ba593d50cf4cbd1530f..fc88118fa773acff6ce05d459f6eecb8b77aa6dc 100644 (file)
@@ -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;
     }