bug-wget
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-wget] Fwd: [PATCH] for potential memory leak in http.c


From: Xin Zou
Subject: [Bug-wget] Fwd: [PATCH] for potential memory leak in http.c
Date: Thu, 8 Jan 2009 09:49:30 +0800

Hi Micah & devs ,

I find  two places may cause memory leak in http.c . When Http
Authorization failed, the function returned without free resp.

And it seems that it has never been fixed since an early version.

Regards,
Xin Zou


Below is patch for the newest code checked out from Mercurial
----------------------------------------------------
--- wget.orig/src/http.c        2008-12-31 12:39:03.000000000 +0800
+++ wget/src/http.c     2009-01-07 22:01:21.000000000 +0800
@@ -1885,6 +1885,7 @@
                  register_basic_auth_host (u->host);
                }
              xfree (pth);
+              resp_free (resp);
              goto retry_with_auth;
            }
          else
@@ -1895,6 +1896,7 @@
        }
      logputs (LOG_NOTQUIET, _("Authorization failed.\n"));
      request_free (req);
+      resp_free (resp);
      return AUTHFAILED;
    }
  else /* statcode != HTTP_STATUS_UNAUTHORIZED */




reply via email to

[Prev in Thread] Current Thread [Next in Thread]