I’m using cURL for the first time and while the documentation seems rather complete, I fail to see where I can find the required lifetime for the curl_easy_setopt() parameters.
Here is an example of what I mean:
char* str = strdup("my user agent");
curl_easy_setopt(curl_handle, CURLOPT_USERAGENT, str);
free(str);
Is curl_handle valid after the call to free() ?
Has str content been copied or is it still referenced directly by curl somewhere ?
From the official docs:
So if you use a recent version of libcurl, you can free the string immediately after setting it.