From c494e9e29d61708a6a3c18bfbf1bea183cc2a50d Mon Sep 17 00:00:00 2001 From: htasta Date: Sat, 16 May 2026 09:53:29 +0200 Subject: [PATCH] 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. --- src/tool_operate.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tool_operate.c b/src/tool_operate.c index 8904859d13..40fb51fce5 100644 --- a/src/tool_operate.c +++ b/src/tool_operate.c @@ -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);