]> sjero.net Git - wget/commitdiff
Fix memory leak.
authorTim Ruehsen <tim.ruehsen@gmx.de>
Sat, 21 Apr 2012 10:08:45 +0000 (12:08 +0200)
committerGiuseppe Scrivano <gscrivano@gnu.org>
Sat, 21 Apr 2012 10:08:45 +0000 (12:08 +0200)
src/ChangeLog
src/ftp-basic.c

index 86d0dd13735afb1316358f02f2fb87db9452f577..a22d25275446fce63e979fdc9f48f3a2485a659d 100644 (file)
@@ -1,3 +1,7 @@
+2012-04-21  Tim Ruehsen  <tim.ruehsen@gmx.de>
+
+       * ftp-basic.c (ftp_pasv): Fix memory leak.
+
 2009-06-14  Phil Pennock  <mutt-dev@spodhuis.org> (tiny change)
        * host.h: Declare `is_valid_ip_address'.
        * host.c (is_valid_ip_address): New function.
index 178fdfea4fa08d94afa36fb85a1b864909b63689..045d125e72d9136f955acc86ad0c5e6ca9d73212 100644 (file)
@@ -524,7 +524,10 @@ ftp_pasv (int csock, ip_address *addr, int *port)
   for (s += 4; *s && !c_isdigit (*s); s++)
     ;
   if (!*s)
-    return FTPINVPASV;
+    {
+      xfree (respline);
+      return FTPINVPASV;
+    }
   for (i = 0; i < 6; i++)
     {
       tmp[i] = 0;
@@ -593,7 +596,10 @@ ftp_lpsv (int csock, ip_address *addr, int *port)
   for (s += 4; *s && !c_isdigit (*s); s++)
     ;
   if (!*s)
-    return FTPINVPASV;
+    {
+      xfree (respline);
+      return FTPINVPASV;
+    }
 
   /* First, get the address family */
   af = 0;