mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:53:34 +03:00
Revert "ftplistparser: keep state between invokes"
This reverts commit abbc8457d8.
Caused fuzzer problems on travis not seen when this was a PR!
This commit is contained in:
parent
a7df35ce21
commit
5c39ccd83f
5 changed files with 32 additions and 43 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -185,13 +185,10 @@ struct ftp_parselist_data *Curl_ftp_parselist_data_alloc(void)
|
|||
}
|
||||
|
||||
|
||||
void Curl_ftp_parselist_data_free(struct ftp_parselist_data **parserp)
|
||||
void Curl_ftp_parselist_data_free(struct ftp_parselist_data **pl_data)
|
||||
{
|
||||
struct ftp_parselist_data *parser = *parserp;
|
||||
if(parser)
|
||||
Curl_fileinfo_cleanup(parser->file_data);
|
||||
free(parser);
|
||||
*parserp = NULL;
|
||||
free(*pl_data);
|
||||
*pl_data = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -316,7 +313,7 @@ static CURLcode ftp_pl_insert_finfo(struct connectdata *conn,
|
|||
Curl_llist_insert_next(llist, llist->tail, finfo, &infop->list);
|
||||
}
|
||||
else {
|
||||
Curl_fileinfo_cleanup(infop);
|
||||
Curl_fileinfo_dtor(NULL, finfo);
|
||||
}
|
||||
|
||||
ftpwc->parser->file_data = NULL;
|
||||
|
|
@ -384,7 +381,7 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
|
|||
finfo->b_data = tmp;
|
||||
}
|
||||
else {
|
||||
Curl_fileinfo_cleanup(parser->file_data);
|
||||
Curl_fileinfo_dtor(NULL, parser->file_data);
|
||||
parser->file_data = NULL;
|
||||
parser->error = CURLE_OUT_OF_MEMORY;
|
||||
goto fail;
|
||||
|
|
@ -1006,13 +1003,12 @@ size_t Curl_ftp_parselist(char *buffer, size_t size, size_t nmemb,
|
|||
|
||||
i++;
|
||||
}
|
||||
return retsize;
|
||||
|
||||
fail:
|
||||
|
||||
/* Clean up any allocated memory. */
|
||||
if(parser->file_data) {
|
||||
Curl_fileinfo_cleanup(parser->file_data);
|
||||
Curl_fileinfo_dtor(NULL, parser->file_data);
|
||||
parser->file_data = NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue