diff options
-rw-r--r-- | dbfp.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -45,6 +45,8 @@ int dbfp_init(struct dbfp *dbfp, char *key) if (!dbfp->key) return ENOMEM; + curl_global_init(CURL_GLOBAL_ALL ^ CURL_GLOBAL_SSL); + return 0; } @@ -53,6 +55,8 @@ void dbfp_close(struct dbfp *dbfp) if (!dbfp) return; + curl_global_cleanup(); + free(dbfp->key); } @@ -144,7 +148,6 @@ static void dbfp_request(struct dbfp *dbfp, char *service, char *query, if (status->run_error) goto cleanup; - curl_global_init(CURL_GLOBAL_ALL ^ CURL_GLOBAL_SSL); curl = curl_easy_init(); if (!curl) { status->error = 1; @@ -165,7 +168,6 @@ static void dbfp_request(struct dbfp *dbfp, char *service, char *query, cleanup: if (curl) curl_easy_cleanup(curl); - curl_global_cleanup(); free(url); } |