test1554: improve the error handling

This commit is contained in:
Michael Kaufmann 2017-12-30 16:51:38 +01:00
parent 593dcc553a
commit 481539e902
1 changed files with 6 additions and 0 deletions

View File

@ -51,6 +51,12 @@ int test(char *URL)
global_init(CURL_GLOBAL_ALL);
share = curl_share_init();
if(!share) {
fprintf(stderr, "curl_share_init() failed\n");
curl_global_cleanup();
return TEST_ERR_MAJOR_BAD;
}
curl_share_setopt(share, CURLSHOPT_SHARE, CURL_LOCK_DATA_CONNECT);
curl_share_setopt(share, CURLSHOPT_LOCKFUNC, my_lock);
curl_share_setopt(share, CURLSHOPT_UNLOCKFUNC, my_unlock);