mirror of
https://github.com/curl/curl.git
synced 2026-07-16 11:17:17 +03:00
examples: check more errors, fix cleanups, scope variables
Inspired by Joshua's report on examples. Closes #19055
This commit is contained in:
parent
61dcb56743
commit
64ed2ea196
42 changed files with 874 additions and 785 deletions
|
|
@ -52,13 +52,15 @@ static const char * const urls[NUMT]= {
|
|||
|
||||
static void *pull_one_url(void *pindex)
|
||||
{
|
||||
int i = *(int *)pindex;
|
||||
CURL *curl;
|
||||
|
||||
curl = curl_easy_init();
|
||||
curl_easy_setopt(curl, CURLOPT_URL, urls[i]);
|
||||
(void)curl_easy_perform(curl); /* ignores error */
|
||||
curl_easy_cleanup(curl);
|
||||
if(curl) {
|
||||
int i = *(int *)pindex;
|
||||
curl_easy_setopt(curl, CURLOPT_URL, urls[i]);
|
||||
(void)curl_easy_perform(curl); /* ignores error */
|
||||
curl_easy_cleanup(curl);
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue