diff options
author | Daniel Stenberg <daniel@haxx.se> | 2001-04-03 10:20:23 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2001-04-03 10:20:23 +0000 |
commit | 28497e7ee40e8e2bf3c50f20c311bf9abff34ea6 (patch) | |
tree | 85bbe960cfe2dedad25122fab285a7d876ee55b1 /lib/ftp.c | |
parent | 87c7f403a9a6d1f57bc50a322ce506775ca25395 (diff) |
better error checks for failure conditions (based on Puneet Pawaia's reports)
Diffstat (limited to 'lib/ftp.c')
-rw-r--r-- | lib/ftp.c | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -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; } |