Daniel Stenberg schrieb: > > Nit: if one curl_slist_append() call fails due to out of mem, this will > lead > to leaked memory. A failure must cleanup the (incomplete) duplicated > list before returning.
I thought the patch would do this already. Say one curl_slist_append() call fails and results NULL. But the input list to curl_slist_append(), which is outcurl->change.cookielist, remains as it is and is not overwritten with NULL (cl_src), due to the break before. So it will be freed with curl_slist_free_all() later (second part of the patch; maybe you just overlooked that? Or maybe I'm just too blind to see...). > > Suggestion: how about making a separate "Curl_dup_cookielist" function > and put > it in the lib/cookie.c file where the other cookie functions live? > To me > it would feel better to keep them close to each other rather than > to put > the full logic within the curl_easy_duphandle() function. > Yes, sounds good. I will do that... cu, Frank.
