]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
wolfssl: Perform cleanup
authorDavid Garske <david@wolfssl.com>
Wed, 19 Dec 2018 16:30:44 +0000 (08:30 -0800)
committerDaniel Gustafsson <daniel@yesql.se>
Thu, 20 Dec 2018 10:32:55 +0000 (11:32 +0100)
This adds a cleanup callback for cyassl. Resolves possible memory leak
when using ECC fixed point cache.

Closes #3395
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
Reviewed-by: Daniel Gustafsson <daniel@yesql.se>
lib/vtls/cyassl.c

index 0d45afbf0c171bf36b927bc2f6cf00698e4e47bd..ea96cf65e510c96895d895cfdcea4d2abd90132c 100644 (file)
@@ -794,6 +794,12 @@ static int Curl_cyassl_init(void)
 }
 
 
+static void Curl_cyassl_cleanup(void)
+{
+  CyaSSL_Cleanup();
+}
+
+
 static bool Curl_cyassl_data_pending(const struct connectdata* conn,
                                      int connindex)
 {
@@ -1004,7 +1010,7 @@ const struct Curl_ssl Curl_ssl_cyassl = {
   sizeof(struct ssl_backend_data),
 
   Curl_cyassl_init,                /* init */
-  Curl_none_cleanup,               /* cleanup */
+  Curl_cyassl_cleanup,             /* cleanup */
   Curl_cyassl_version,             /* version */
   Curl_none_check_cxn,             /* check_cxn */
   Curl_cyassl_shutdown,            /* shutdown */