diff --git a/src/ChangeLog b/src/ChangeLog index 86d0dd13..a22d2527 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-04-21 Tim Ruehsen + + * ftp-basic.c (ftp_pasv): Fix memory leak. + 2009-06-14 Phil Pennock (tiny change) * host.h: Declare `is_valid_ip_address'. * host.c (is_valid_ip_address): New function. diff --git a/src/ftp-basic.c b/src/ftp-basic.c index 178fdfea..045d125e 100644 --- a/src/ftp-basic.c +++ b/src/ftp-basic.c @@ -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;