Open sch-m opened 3 years ago
Calling curl_global_init() and curl_global_cleanup() on every http_client_init() / http_client_exit() leads to memory leak (at least, if you use it with OpenSSL).
The official documentation also says that curl_global_init() should only be called once: https://ec.haxx.se/libcurl/libcurl-globalinit
So this patch changes the code to call the curl_global_init() and curl_global_cleanup() in the main() function only once.
Signed-off-by: Martin Schiller ms@dev.tdt.de
thank you for the contribution
Calling curl_global_init() and curl_global_cleanup() on every http_client_init() / http_client_exit() leads to memory leak (at least, if you use it with OpenSSL).
The official documentation also says that curl_global_init() should only be called once: https://ec.haxx.se/libcurl/libcurl-globalinit
So this patch changes the code to call the curl_global_init() and curl_global_cleanup() in the main() function only once.
Signed-off-by: Martin Schiller ms@dev.tdt.de