]> granicus.if.org Git - curl/commitdiff
Fixed an OOM problem with test 560
authorDan Fandrich <dan@coneharvesters.com>
Wed, 12 Nov 2008 22:26:06 +0000 (22:26 +0000)
committerDan Fandrich <dan@coneharvesters.com>
Wed, 12 Nov 2008 22:26:06 +0000 (22:26 +0000)
tests/libtest/lib560.c

index e9d51c4d19b96e84ecda8ce009db22193898a72f..d2de7bfb4134de0c9b8f607299184696591575f9 100644 (file)
@@ -28,6 +28,8 @@ int test(char *URL)
   int still_running; /* keep number of running handles */
 
   http_handle = curl_easy_init();
+  if (!http_handle)
+    return TEST_ERR_MAJOR_BAD;
 
   /* set options */
   curl_easy_setopt(http_handle, CURLOPT_URL, URL);
@@ -37,6 +39,10 @@ int test(char *URL)
 
   /* init a multi stack */
   multi_handle = curl_multi_init();
+  if (!multi_handle) {
+    curl_easy_cleanup(http_handle);
+    return TEST_ERR_MAJOR_BAD;
+  }
 
   /* add the individual transfers */
   curl_multi_add_handle(multi_handle, http_handle);