From: Daniel Stenberg Date: Mon, 15 Mar 2004 16:28:36 +0000 (+0000) Subject: if the global_init() is called from within curl_easy_init() and returns X-Git-Tag: upstream/7.37.1~13160 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=256a16a8a3a738e400e2cbb97ea770f14414e44c;p=platform%2Fupstream%2Fcurl.git 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. --- diff --git a/lib/easy.c b/lib/easy.c index 4c4e271..d1e7ef4 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);