summaryrefslogtreecommitdiffstats
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>1996-08-23 09:33:32 +0000
committerphk <phk@FreeBSD.org>1996-08-23 09:33:32 +0000
commita283f65a081238a89c83b01ef3f768e42ea03775 (patch)
tree0de02b3e0dd85eb4667c291034b8dd0a26f56bf3 /usr.bin/ftp
parentd3739879c900835e0dc24200f02147d90e6a04ef (diff)
downloadFreeBSD-src-a283f65a081238a89c83b01ef3f768e42ea03775.zip
FreeBSD-src-a283f65a081238a89c83b01ef3f768e42ea03775.tar.gz
Fix a couple of file-descriptor leaks.
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/ftp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index fd091b4..6b499c43 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1015,6 +1015,7 @@ initconn()
perror("ftp: setsockopt (ignored)");
if (command("PASV") != COMPLETE) {
printf("Passive mode refused.\n");
+ close(data);
return(1);
}
@@ -1029,6 +1030,7 @@ initconn()
if (sscanf(pasv,"%d,%d,%d,%d,%d,%d",&a1,&a2,&a3,&a4,&p1,&p2)
!= 6) {
printf("Passive mode address scan failure. Shouldn't happen!\n");
+ close(data);
return(1);
};
@@ -1040,6 +1042,7 @@ initconn()
if (connect(data, (struct sockaddr *) &data_addr,
sizeof(data_addr))<0) {
perror("ftp: connect");
+ close(data);
return(1);
}
#ifdef IP_TOS
OpenPOWER on IntegriCloud