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:
htasta 2026-05-16 09:53:29 +02:00
parent 262a2c843d
commit c494e9e29d

View file

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