better error checks for failure conditions (based on Puneet Pawaia's reports)
This commit is contained in:
16
lib/ftp.c
16
lib/ftp.c
@@ -1720,12 +1720,14 @@ CURLcode Curl_ftp_disconnect(struct connectdata *conn)
|
||||
{
|
||||
struct FTP *ftp= conn->proto.ftp;
|
||||
|
||||
if(ftp->user)
|
||||
free(ftp->user);
|
||||
if(ftp->passwd)
|
||||
free(ftp->passwd);
|
||||
if(ftp->entrypath)
|
||||
free(ftp->entrypath);
|
||||
|
||||
/* The FTP session may or may not have been allocated/setup at this point! */
|
||||
if(ftp) {
|
||||
if(ftp->user)
|
||||
free(ftp->user);
|
||||
if(ftp->passwd)
|
||||
free(ftp->passwd);
|
||||
if(ftp->entrypath)
|
||||
free(ftp->entrypath);
|
||||
}
|
||||
return CURLE_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user