From f1d4aeaffb7f682d825ecd6d85a71b1e4a30f189 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Sat, 21 Apr 2012 12:08:45 +0200 Subject: [PATCH] Fix memory leak. --- src/ChangeLog | 4 ++++ src/ftp-basic.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) 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;