[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnurl] 70/151: global_init: undo the "intialized" bump in case of failu
From: |
gnunet |
Subject: |
[gnurl] 70/151: global_init: undo the "intialized" bump in case of failure |
Date: |
Fri, 20 Dec 2019 14:26:19 +0100 |
This is an automated email from the git hooks/post-receive script.
ng0 pushed a commit to branch master
in repository gnurl.
commit bc5d22c3dede2f04870c37aec9a50474c4b888ad
Author: Daniel Stenberg <address@hidden>
AuthorDate: Thu Nov 28 16:21:58 2019 +0100
global_init: undo the "intialized" bump in case of failure
... so that failures in the global init function don't count as a
working init and it can then be called again.
Reported-by: Paul Groke
Fixes #4636
Closes #4653
---
lib/easy.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/lib/easy.c b/lib/easy.c
index 1d02c0cc1..6382cee3d 100644
--- a/lib/easy.c
+++ b/lib/easy.c
@@ -157,20 +157,20 @@ static CURLcode global_init(long flags, bool memoryfuncs)
if(!Curl_ssl_init()) {
DEBUGF(fprintf(stderr, "Error: Curl_ssl_init failed\n"));
- return CURLE_FAILED_INIT;
+ goto fail;
}
#ifdef WIN32
if(Curl_win32_init(flags)) {
DEBUGF(fprintf(stderr, "Error: win32_init failed\n"));
- return CURLE_FAILED_INIT;
+ goto fail;
}
#endif
#ifdef __AMIGA__
if(!Curl_amiga_init()) {
DEBUGF(fprintf(stderr, "Error: Curl_amiga_init failed\n"));
- return CURLE_FAILED_INIT;
+ goto fail;
}
#endif
@@ -182,14 +182,14 @@ static CURLcode global_init(long flags, bool memoryfuncs)
if(Curl_resolver_global_init()) {
DEBUGF(fprintf(stderr, "Error: resolver_global_init failed\n"));
- return CURLE_FAILED_INIT;
+ goto fail;
}
(void)Curl_ipv6works();
#if defined(USE_SSH)
if(Curl_ssh_init()) {
- return CURLE_FAILED_INIT;
+ goto fail;
}
#endif
@@ -201,6 +201,10 @@ static CURLcode global_init(long flags, bool memoryfuncs)
Curl_version_init();
return CURLE_OK;
+
+ fail:
+ initialized--; /* undo the increase */
+ return CURLE_FAILED_INIT;
}
--
To stop receiving notification emails like this one, please contact
address@hidden.
- [gnurl] 53/151: XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE, (continued)
- [gnurl] 53/151: XFERINFOFUNCTION: support CURL_PROGRESSFUNC_CONTINUE, gnunet, 2019/12/20
- [gnurl] 66/151: curl_setup_once: consistently use WHILE_FALSE in macros, gnunet, 2019/12/20
- [gnurl] 48/151: checksrc.bat: Add a check for vquic and vssh directories, gnunet, 2019/12/20
- [gnurl] 64/151: checksrc: fix regexp for ASSIGNWITHINCONDITION, gnunet, 2019/12/20
- [gnurl] 58/151: travis: build ngtcp2 with --enable-lib-only, gnunet, 2019/12/20
- [gnurl] 51/151: curl_multi_wakeup.3: add example and AVAILABILITY, gnunet, 2019/12/20
- [gnurl] 55/151: dist: add error-codes.pl, gnunet, 2019/12/20
- [gnurl] 63/151: RELEASE-NOTES: synced, gnunet, 2019/12/20
- [gnurl] 59/151: doh: use dedicated probe slots, gnunet, 2019/12/20
- [gnurl] 62/151: curl: two new command line options for etags, gnunet, 2019/12/20
- [gnurl] 70/151: global_init: undo the "intialized" bump in case of failure,
gnunet <=
- [gnurl] 67/151: sha256: bump the copyright year range, gnunet, 2019/12/20
- [gnurl] 50/151: multi: add curl_multi_wakeup(), gnunet, 2019/12/20
- [gnurl] 69/151: parsedate: offer a getdate_capped() alternative, gnunet, 2019/12/20
- [gnurl] 52/151: TLS: add BearSSL vtls implementation, gnunet, 2019/12/20
- [gnurl] 86/151: hostip4.c: bump copyright year range, gnunet, 2019/12/20
- [gnurl] 75/151: docs: add "added: 7.68.0" to the --etag-* docs, gnunet, 2019/12/20
- [gnurl] 81/151: openssl: set X509_V_FLAG_PARTIAL_CHAIN, gnunet, 2019/12/20
- [gnurl] 78/151: travis: do not use OVERRIDE_CC or OVERRIDE_CXX if empty, gnunet, 2019/12/20
- [gnurl] 91/151: curl_setup: fix `CURLRES_IPV6` condition, gnunet, 2019/12/20
- [gnurl] 71/151: strerror: Add Curl_winapi_strerror for Win API specific errors, gnunet, 2019/12/20