summaryrefslogtreecommitdiffstats
path: root/lib/libfetch
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/common.c4
-rw-r--r--lib/libfetch/ftp.c5
2 files changed, 5 insertions, 4 deletions
diff --git a/lib/libfetch/common.c b/lib/libfetch/common.c
index cb69ec0..4b2e6ea 100644
--- a/lib/libfetch/common.c
+++ b/lib/libfetch/common.c
@@ -271,8 +271,10 @@ _fetch_connect(const char *host, int port, int af, int verbose)
return (NULL);
}
- if ((conn = _fetch_reopen(sd)) == NULL)
+ if ((conn = _fetch_reopen(sd)) == NULL) {
+ _fetch_syserr();
close(sd);
+ }
return (conn);
}
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index b08dd30..7897adf 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -796,10 +796,9 @@ _ftp_connect(struct url *url, struct url *purl, const char *flags)
}
/* check connection */
- if (conn == NULL) {
- _fetch_syserr();
+ if (conn == NULL)
+ /* _fetch_connect() has already set an error code */
return (NULL);
- }
/* expect welcome message */
if ((e = _ftp_chkerr(conn)) != FTP_SERVICE_READY)
OpenPOWER on IntegriCloud