aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2004-03-15 16:28:36 +0000
committerDaniel Stenberg <daniel@haxx.se>2004-03-15 16:28:36 +0000
commit256a16a8a3a738e400e2cbb97ea770f14414e44c (patch)
treee9356ee4b54718e9457e445bd5ecd903b37ff1d4 /lib
parent30e0891d3d8cd5bf2f3aa507b524c659ac4c0dd9 (diff)
if the global_init() is called from within curl_easy_init() and returns
an error code, we now make curl_easy_init fail and return NULL.
Diffstat (limited to 'lib')
-rw-r--r--lib/easy.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/easy.c b/lib/easy.c
index 4c4e271f6..d1e7ef442 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -198,8 +198,12 @@ CURL *curl_easy_init(void)
struct SessionHandle *data;
/* Make sure we inited the global SSL stuff */
- if (!initialized)
- curl_global_init(CURL_GLOBAL_DEFAULT);
+ if (!initialized) {
+ res = curl_global_init(CURL_GLOBAL_DEFAULT);
+ if(res)
+ /* something in the global init failed, return nothing */
+ return NULL;
+ }
/* We use curl_open() with undefined URL so far */
res = Curl_open(&data);