From 2a1bc30a5403dcde479bf3125af15617f42f04c5 Mon Sep 17 00:00:00 2001 From: wessels <> Date: Thu, 1 Jan 1998 00:52:04 +0000 Subject: [PATCH] Add comm_add_close_handler() for ftpState->data.fd. If the data socket connection failed, then a comm_close() call was closing the data socket, but not freeing up the ftpState. --- src/ftp.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/ftp.cc b/src/ftp.cc index 75415d6df6..c822b74eae 100644 --- a/src/ftp.cc +++ b/src/ftp.cc @@ -1,6 +1,6 @@ /* - * $Id: ftp.cc,v 1.180 1997/12/06 05:16:56 wessels Exp $ + * $Id: ftp.cc,v 1.181 1997/12/31 17:52:04 wessels Exp $ * * DEBUG: section 9 File Transfer Protocol (FTP) * AUTHOR: Harvest Derived @@ -1378,6 +1378,7 @@ ftpSendPasv(FtpStateData * ftpState) ftpFail(ftpState); return; } + comm_add_close_handler(fd, ftpStateFree, ftpState); ftpState->data.fd = fd; snprintf(cbuf, 1024, "PASV\r\n"); ftpWriteCommand(cbuf, ftpState); @@ -1403,7 +1404,7 @@ ftpReadPasv(FtpStateData * ftpState) return; } if (strlen(buf) > 1024) { - debug(9, 1) ("Avoiding potential buffer overflow\n"); + debug(9, 1) ("ftpReadPasv: Avoiding potential buffer overflow\n"); ftpSendPort(ftpState); return; } -- 2.47.2