aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2009-03-11 22:56:03 +0000
committerDaniel Stenberg <daniel@haxx.se>2009-03-11 22:56:03 +0000
commit6173e38fdcf5a9db84be511dfcf0037b8339c0bb (patch)
treed3553dd938e077e548d96941ee3afb93f13d967f /src
parent34cd99d1d9baa0841890188e95aa2e2255bf5afc (diff)
- Kamil Dudka made the curl tool properly call curl_global_init() before any
other libcurl function.
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index aabd659fe..26fa3c85b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3969,6 +3969,12 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
memset(&heads, 0, sizeof(struct OutStruct));
+ /* initialize curl library - do not call any libcurl functions before */
+ if (main_init() != CURLE_OK) {
+ helpf(config->errors, "error initializing curl library\n");
+ return CURLE_FAILED_INIT;
+ }
+
#ifdef CURLDEBUG
/* this sends all memory debug messages to a logfile named memdump */
env = curlx_getenv("CURL_MEMDEBUG");
@@ -4015,10 +4021,6 @@ operate(struct Configurable *config, int argc, argv_item_t argv[])
#endif
/* inits */
- if (main_init() != CURLE_OK) {
- helpf(config->errors, "error initializing curl library\n");
- return CURLE_FAILED_INIT;
- }
config->postfieldsize = -1;
config->showerror=TRUE;
config->use_httpget=FALSE;