mirror of
https://github.com/curl/curl.git
synced 2026-08-03 10:10:28 +03:00
tool: dont alloc extra space for origins in the 429 delay list
the list's lifetime is tied to the pre->transfers, so when the origin living in per-transfer will be freed the list is freed too.
This commit is contained in:
parent
262a2c843d
commit
c494e9e29d
1 changed files with 2 additions and 3 deletions
|
|
@ -201,7 +201,7 @@ static struct curl_429_list *http_429_list = NULL;
|
|||
* On error the function returns NULL, otherwise the list is returned.
|
||||
*/
|
||||
static struct curl_429_list *curl_429_delay_set(struct curl_429_list *list,
|
||||
const char *origin,
|
||||
char *origin,
|
||||
uint32_t delayms)
|
||||
{
|
||||
struct curl_429_list *item = NULL;
|
||||
|
|
@ -226,7 +226,7 @@ static struct curl_429_list *curl_429_delay_set(struct curl_429_list *list,
|
|||
new_item = curlx_malloc(sizeof(struct curl_429_list));
|
||||
if(!new_item)
|
||||
return NULL;
|
||||
new_item->origin = curlx_strdup(origin);
|
||||
new_item->origin = origin;
|
||||
if(!new_item->origin) {
|
||||
curlx_free(new_item);
|
||||
return NULL;
|
||||
|
|
@ -271,7 +271,6 @@ static void curl_429_delay_free_all(struct curl_429_list *list)
|
|||
item = list;
|
||||
do {
|
||||
next = item->next;
|
||||
curlx_safefree(item->origin);
|
||||
curlx_free(item);
|
||||
item = next;
|
||||
} while(next);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue