mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:43:34 +03:00
better error checks for failure conditions (based on Puneet Pawaia's reports)
This commit is contained in:
parent
87c7f403a9
commit
28497e7ee4
3 changed files with 16 additions and 9 deletions
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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue