From 76d29b2eda54ff250a66580478fb8fdca221ca8c Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 4 Jan 2021 12:38:39 +0200 Subject: [PATCH] Fixed: Only call curl cleanup when needed. --- nel/src/web/http_client_curl.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nel/src/web/http_client_curl.cpp b/nel/src/web/http_client_curl.cpp index 10bb0776c..b62300089 100644 --- a/nel/src/web/http_client_curl.cpp +++ b/nel/src/web/http_client_curl.cpp @@ -55,7 +55,10 @@ bool CCurlHttpClient::connect(const std::string &/* server */) curl_global_init(CURL_GLOBAL_ALL); _CurlStruct = curl_easy_init(); if(_Curl == NULL) + { + curl_global_cleanup(); return false; + } return true; } @@ -195,8 +198,8 @@ void CCurlHttpClient::disconnect() { curl_easy_cleanup(_Curl); _CurlStruct = NULL; + curl_global_cleanup(); } - curl_global_cleanup(); } CCurlHttpClient CurlHttpClient;