Skip to content

Conversation

sch-m
Copy link

@sch-m sch-m commented Jan 13, 2021

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

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>
@pivasoftware
Copy link
Owner

thank you for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants