add Daniel's extra check, pass NULL on init more, apply to 5000

This commit is contained in:
Viktor Szakats 2026-07-30 10:08:58 +02:00
parent 0a9a2302b4
commit 067e240321
No known key found for this signature in database
2 changed files with 18 additions and 4 deletions

View file

@ -50,7 +50,9 @@ static CURLcode test_lib5000(const char *URL)
easy_setopt(curl, CURLOPT_HEADER, 0L);
easy_setopt(curl, CURLOPT_URL, URL);
if(libtest_arg2) {
connect_to = curl_slist_append(connect_to, libtest_arg2);
connect_to = curl_slist_append(NULL, libtest_arg2);
if(!connect_to)
goto test_cleanup;
}
easy_setopt(curl, CURLOPT_CONNECT_TO, connect_to);

View file

@ -34,6 +34,7 @@ static CURLcode test_lib5004(const char *URL)
CURLcode result = TEST_ERR_MAJOR_BAD;
struct curl_slist *connect_to = NULL;
struct curl_slist *headers = NULL;
struct curl_slist *nheaders;
if(curl_global_init(CURL_GLOBAL_ALL) != CURLE_OK) {
curl_mfprintf(stderr, "curl_global_init() failed\n");
@ -60,14 +61,25 @@ static CURLcode test_lib5004(const char *URL)
headers = curl_slist_append(NULL, "Date: Tue, 20 Apr 2021 02:07:55 GMT");
if(!headers)
goto test_cleanup;
curl_slist_append(headers, "Content-Type: application/json");
curl_slist_append(headers, "Content-Length: 18");
nheaders = curl_slist_append(headers, "Content-Type: application/json");
if(!nheaders)
goto test_cleanup;
headers = nheaders;
nheaders = curl_slist_append(headers, "Content-Length: 18");
if(!nheaders)
goto test_cleanup;
headers = nheaders;
easy_setopt(curl, CURLOPT_HTTPHEADER, headers);
easy_setopt(curl, CURLOPT_HEADER, 0L);
easy_setopt(curl, CURLOPT_URL, URL);
if(libtest_arg2) {
connect_to = curl_slist_append(connect_to, libtest_arg2);
connect_to = curl_slist_append(NULL, libtest_arg2);
if(!connect_to)
goto test_cleanup;
}
easy_setopt(curl, CURLOPT_CONNECT_TO, connect_to);