aboutsummaryrefslogtreecommitdiff
path: root/lib/ftp.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2008-09-02 23:12:00 +0000
committerDan Fandrich <dan@coneharvesters.com>2008-09-02 23:12:00 +0000
commit29ec219b82ba65fd4be0fd7c9d678eb9ae1890b7 (patch)
tree6f90fe82daf5d1b35a838c7156d3fac93313a5ce /lib/ftp.c
parent0994d7811f691f0b5c6743ae8d3ce90310cd7cea (diff)
Fixed an out of memory problem that caused torture test failures in tests
706 and 707.
Diffstat (limited to 'lib/ftp.c')
-rw-r--r--lib/ftp.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index d53134d5b..1b09e9cfd 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -1825,6 +1825,11 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
connectport =
(unsigned short)conn->port; /* we connect to the proxy's port */
+ if(!addr) {
+ failf(data, "Can't resolve proxy host %s:%d",
+ conn->proxy.name, connectport);
+ return CURLE_FTP_CANT_GET_HOST;
+ }
}
else {
/* normal, direct, ftp connection */
@@ -1833,11 +1838,12 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
/* BLOCKING */
rc = Curl_wait_for_resolv(conn, &addr);
+ connectport = newport; /* we connect to the remote port */
+
if(!addr) {
- failf(data, "Can't resolve new host %s:%d", newhost, newport);
+ failf(data, "Can't resolve new host %s:%d", newhost, connectport);
return CURLE_FTP_CANT_GET_HOST;
}
- connectport = newport; /* we connect to the remote port */
}
result = Curl_connecthost(conn,