better error checks for failure conditions (based on Puneet Pawaia's reports)

This commit is contained in:
Daniel Stenberg
2001-04-03 10:20:23 +00:00
parent 87c7f403a9
commit 28497e7ee4
3 changed files with 16 additions and 9 deletions

View File

@@ -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;
}