]> sjero.net Git - wget/commitdiff
[svn] Fixed minor memory leaks.
authorhniksic <devnull@localhost>
Thu, 2 Nov 2000 00:18:27 +0000 (16:18 -0800)
committerhniksic <devnull@localhost>
Thu, 2 Nov 2000 00:18:27 +0000 (16:18 -0800)
src/ChangeLog
src/retr.c

index f4f7336fb8d95ff69f82fa6f103d47c84d2e05cf..833671f1f543746130bda198096c8343a983dcea 100644 (file)
@@ -1,3 +1,9 @@
+2000-11-02  Hrvoje Niksic  <hniksic@arsdigita.com>
+
+       * retr.c (retrieve_url): Free url before returning.
+       (retrieve_url): Free mynewloc before returning.
+       Spotted by Mark A. Mankins <Mankins_Mark@prc.com>.
+
 2000-11-02  Hrvoje Niksic  <hniksic@arsdigita.com>
 
        * url.c (parseurl): Remove possible reading past the end of
index 5f9327a3d75f292166f3dba3243f42e4282813b4..3d5a32101af4e9a4f8e6b18de35cc231189ea9a1 100644 (file)
@@ -344,6 +344,7 @@ retrieve_url (const char *origurl, char **file, char **newloc,
       logprintf (LOG_NOTQUIET, "%s: %s.\n", url, uerrmsg (result));
       freeurl (u, 1);
       free_slist (redirections);
+      free (url);
       return result;
     }
 
@@ -379,6 +380,7 @@ retrieve_url (const char *origurl, char **file, char **newloc,
          logputs (LOG_NOTQUIET, _("Could not find proxy host.\n"));
          freeurl (u, 1);
          free_slist (redirections);
+         free (url);
          return PROXERR;
        }
       /* Parse the proxy URL.  */
@@ -391,6 +393,7 @@ retrieve_url (const char *origurl, char **file, char **newloc,
            logprintf (LOG_NOTQUIET, _("Proxy %s: Must be HTTP.\n"), proxy);
          freeurl (u, 1);
          free_slist (redirections);
+         free (url);
          return PROXERR;
        }
       u->proto = URLHTTP;
@@ -452,6 +455,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
          freeurl (newloc_struct, 1);
          freeurl (u, 1);
          free_slist (redirections);
+         free (url);
+         free (mynewloc);
          return result;
        }
 
@@ -469,6 +474,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
          freeurl (newloc_struct, 1);
          freeurl (u, 1);
          free_slist (redirections);
+         free (url);
+         free (mynewloc);
          return WRONGCODE;
        }
 
@@ -481,6 +488,8 @@ retrieve_url (const char *origurl, char **file, char **newloc,
          freeurl (newloc_struct, 1);
          freeurl (u, 1);
          free_slist (redirections);
+         free (url);
+         free (mynewloc);
          return WRONGCODE;
        }
 
@@ -600,7 +609,7 @@ downloaded_exceeds_quota (void)
   if (!opt.quota)
     return 0;
   if (opt.downloaded_overflow)
-    /* We don't really no.  (Wildly) assume not. */
+    /* We don't really know.  (Wildly) assume not. */
     return 0;
 
   return opt.downloaded > opt.quota;