Fix Curl_open() not reporting failure when allocation of the
authorYang Tse <yangsita@gmail.com>
Thu, 26 Oct 2006 11:15:25 +0000 (11:15 +0000)
committerYang Tse <yangsita@gmail.com>
Thu, 26 Oct 2006 11:15:25 +0000 (11:15 +0000)
buffer used to store headers in the SessionHandle failed.

lib/url.c

index abbcafa..03a0b6e 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -564,9 +564,10 @@ CURLcode Curl_open(struct SessionHandle **curl)
     free(data);
     data = NULL;
   }
+  else
+    *curl = data;
 
-  *curl = data;
-  return CURLE_OK;
+  return res;
 }
 
 CURLcode Curl_setopt(struct SessionHandle *data, CURLoption option,