diff options
author | Yang Tse <yangsita@gmail.com> | 2011-08-31 03:50:07 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2011-08-31 03:50:07 +0200 |
commit | d20408e8161a55b8408a47a33d89ee8d37b6e146 (patch) | |
tree | bf10e70d9463fda65ddb3b9a81e4dc008652e840 /lib | |
parent | c06de200252fedc348af27ad9de9893d7c0a9a4d (diff) |
fix some leaks torture tests detected 2011-08-30
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ftp.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -999,8 +999,10 @@ static CURLcode ftp_state_use_port(struct connectdata *conn, result = Curl_pp_sendf(&ftpc->pp, "%s |%d|%s|%hu|", mode[fcmd], sa->sa_family == AF_INET?1:2, myhost, port); - if(result) + if(result) { + Curl_closesocket(conn, portsock); return result; + } break; } else if(PORT == fcmd) { @@ -1020,8 +1022,10 @@ static CURLcode ftp_state_use_port(struct connectdata *conn, snprintf(dest, 20, ",%d,%d", (int)(port>>8), (int)(port&0xff)); result = Curl_pp_sendf(&ftpc->pp, "%s %s", mode[fcmd], tmp); - if(result) + if(result) { + Curl_closesocket(conn, portsock); return result; + } break; } } |