pivasoftware / easycwmp

EasyCwmp:
http://www.easycwmp.org/
GNU General Public License v2.0
73 stars 59 forks source link

Fix libcurl related memory leak #43

Open sch-m opened 3 years ago

sch-m commented 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

pivasoftware commented 3 years ago

thank you for the contribution