]> granicus.if.org Git - curl/commitdiff
Call curl_global_cleanup() in all code paths before exiting test
authorYang Tse <yangsita@gmail.com>
Tue, 10 Oct 2006 23:50:37 +0000 (23:50 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 10 Oct 2006 23:50:37 +0000 (23:50 +0000)
tests/libtest/lib525.c
tests/libtest/lib526.c
tests/libtest/lib530.c
tests/libtest/lib533.c

index 2406280282d15d7f23c2db28c07a1b825296f594..9dcddaecfafbd202f12ae1038f22d5a0c0f9a63d 100644 (file)
@@ -45,9 +45,11 @@ int test(char *URL)
 
   /* get a curl handle */
   curl = curl_easy_init();
-  if(!curl)
+  if(!curl) {
+    fclose(hd_src);
+    curl_global_cleanup();
     return 100; /* major bad */
-
+  }
 
   /* enable uploading */
   curl_easy_setopt(curl, CURLOPT_UPLOAD, TRUE) ;
index bf16c510ee6121195dee4d7a81fb700834cf24af..dce6a9f1beec57f136670d09ee8e2938807cd322 100644 (file)
@@ -51,8 +51,10 @@ int test(char *URL)
   /* get NUM_HANDLES easy handles */
   for(i=0; i < NUM_HANDLES; i++) {
     curl[i] = curl_easy_init();
-    if(!curl[i])
+    if(!curl[i]) {
+      curl_global_cleanup();
       return 100 + i; /* major bad */
+    }
     curl_easy_setopt(curl[i], CURLOPT_URL, URL);
 
     /* go verbose */
index 3e6cd3faca04b2de9c10049a990c5859e15f929b..d062886f462849f752ba8fbe10dc9e14569956bc 100644 (file)
@@ -32,8 +32,10 @@ int test(char *URL)
   /* get NUM_HANDLES easy handles */
   for(i=0; i < NUM_HANDLES; i++) {
     curl[i] = curl_easy_init();
-    if(!curl[i])
+    if(!curl[i]) {
+      curl_global_cleanup();
       return 100 + i; /* major bad */
+    }
     curl_easy_setopt(curl[i], CURLOPT_URL, URL);
 
     /* go verbose */
index a4b6877efd0a3c422af06041191ce6a21a23cb5a..74499c2325a212ca4fb05d434b5557a034f9d2a5 100644 (file)
@@ -29,8 +29,10 @@ int test(char *URL)
   curl_global_init(CURL_GLOBAL_ALL);
 
   curl = curl_easy_init();
-  if(!curl)
+  if(!curl) {
+    curl_global_cleanup();
     return 100; /* major bad */
+  }
 
   curl_easy_setopt(curl, CURLOPT_URL, URL);
   curl_easy_setopt(curl, CURLOPT_VERBOSE, 1);