Libcurl curl_slist_append() leads to memory leak.

2022-04-22 Thread Iku_ex Diaz via curl-library
*System* x86 with Linux Ubuntu 22.04 *Problem* I'm running a program that uses libcurl to perform 3 requests, one GET, and two PUT. Using *Valgrind *outputs several memory leaks originated at the *curl_slist_append() *calls for the two PUT requests. *TRACE:* ==15078== HEAP SUMMARY: ==15078==

Re: Libcurl curl_slist_append() leads to memory leak.

2022-04-22 Thread Kerry Loux via curl-library
It looks like you're missing a call to curl_slist_free_all(). See: https://curl.se/libcurl/c/curl_slist_append.html -Kerry On Fri, Apr 22, 2022 at 9:25 AM Iku_ex Diaz via curl-library wrote: > > System > x86 with Linux Ubuntu 22.04 > > Problem > I'm running a program that uses libcurl to perfo

Re: Libcurl curl_slist_append() leads to memory leak.

2022-04-22 Thread Timothe Litt via curl-library
Besides not calling curl_slist_free_all() per list_append.html The list should be freed again (after usage) withcurl_slist_free_all . (Someone beat me to pointing that out...) If the code shown is complete, you're not using the headers -

Re: Libcurl curl_slist_append() leads to memory leak.

2022-04-25 Thread Iku_ex Diaz via curl-library
Thank you for the help! Indeed I was missing the call to free the slist (and also re-asign the list to the append call, which I wasn't doing as well). It solved the problem. Cheers, Iker El vie, 22 abr 2022 a las 15:40, Timothe Litt via curl-library (< curl-library@lists.haxx.se>) escribió: > Be