1
0
mirror of https://github.com/moparisthebest/curl synced 2024-08-13 17:03:50 -04:00

if the PWD reply parser failed, we leaked memory

This commit is contained in:
Daniel Stenberg 2002-12-02 07:18:24 +00:00
parent 3f8ba3a986
commit ff5308a5af

View File

@ -544,7 +544,7 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
The directory name can contain any character; embedded double-quotes The directory name can contain any character; embedded double-quotes
should be escaped by double-quotes (the "quote-doubling" convention). should be escaped by double-quotes (the "quote-doubling" convention).
*/ */
if('\"' == *ptr) { if(dir && ('\"' == *ptr)) {
/* it started good */ /* it started good */
ptr++; ptr++;
while(ptr && *ptr) { while(ptr && *ptr) {
@ -570,6 +570,8 @@ CURLcode Curl_ftp_connect(struct connectdata *conn)
} }
else { else {
/* couldn't get the path */ /* couldn't get the path */
free(dir);
infof(data, "Failed to figure out path\n");
} }
} }