aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorPatrick Monnerat <pm@datasphere.ch>2015-05-08 15:26:59 +0200
committerPatrick Monnerat <pm@datasphere.ch>2015-05-08 15:28:48 +0200
commitc720cd6356926c37071370c48cbe1575488cddcc (patch)
treea96989b8d410ba49af068f7cb0ecf2bc8bad0da3 /lib
parent3377e692eec627710f06ca6a721efd9e167ff907 (diff)
FTP: fix dangling conn->ip_addr dereference on verbose EPSV.
Diffstat (limited to 'lib')
-rw-r--r--lib/ftp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/ftp.c b/lib/ftp.c
index 8048618b4..e04f58361 100644
--- a/lib/ftp.c
+++ b/lib/ftp.c
@@ -2073,9 +2073,8 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
conn->bits.tcpconnect[SECONDARYSOCKET] = FALSE;
result = Curl_connecthost(conn, addr);
- Curl_resolv_unlock(data, addr); /* we're done using this address */
-
if(result) {
+ Curl_resolv_unlock(data, addr); /* we're done using this address */
if(ftpc->count1 == 0 && ftpcode == 229)
return ftp_epsv_disable(conn);
@@ -2091,8 +2090,9 @@ static CURLcode ftp_state_pasv_resp(struct connectdata *conn,
if(data->set.verbose)
/* this just dumps information about this second connection */
- ftp_pasv_verbose(conn, conn->ip_addr, ftpc->newhost, connectport);
+ ftp_pasv_verbose(conn, addr->addr, ftpc->newhost, connectport);
+ Curl_resolv_unlock(data, addr); /* we're done using this address */
conn->bits.do_more = TRUE;
state(conn, FTP_STOP); /* this phase is completed */