]> granicus.if.org Git - curl/commitdiff
test1554: improve the error handling
authorMichael Kaufmann <mail@michael-kaufmann.ch>
Sat, 30 Dec 2017 15:51:38 +0000 (16:51 +0100)
committerMichael Kaufmann <mail@michael-kaufmann.ch>
Sat, 30 Dec 2017 15:52:51 +0000 (16:52 +0100)
tests/libtest/lib1554.c

index 35dbf2c1e6f8742f131ef80d0c88bf5c5b104b98..8842ae2f73fdf86d536ace59d9f0cdee395ab9cf 100644 (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);