[glib-openssl] Properly free the store context



commit 18e39cd6feb8a5aea497a58f17d53d34675e02ea
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date:   Wed May 17 15:09:04 2017 +0200

    Properly free the store context

 tls/openssl/gtlscertificate-openssl.c  |    6 +++---
 tls/openssl/gtlsfiledatabase-openssl.c |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
index cff0122..71d1643 100644
--- a/tls/openssl/gtlscertificate-openssl.c
+++ b/tls/openssl/gtlscertificate-openssl.c
@@ -316,7 +316,7 @@ g_tls_certificate_openssl_verify (GTlsCertificate     *cert,
       if (!X509_STORE_CTX_init (csc, store, x, untrusted))
         {
           sk_X509_free (untrusted);
-          X509_STORE_CTX_cleanup (csc);
+          X509_STORE_CTX_free (csc);
           X509_STORE_free (store);
           return G_TLS_CERTIFICATE_GENERIC_ERROR;
         }
@@ -334,7 +334,7 @@ g_tls_certificate_openssl_verify (GTlsCertificate     *cert,
         gtls_flags |= g_tls_certificate_openssl_convert_error (X509_STORE_CTX_get_error (csc));
 
       sk_X509_free (trusted);
-      X509_STORE_CTX_cleanup (csc);
+      X509_STORE_CTX_free (csc);
       X509_STORE_free (store);
     }
 
@@ -639,7 +639,7 @@ is_issuer (GTlsCertificateOpenssl *cert,
   sk_X509_free (trusted);
 
 end:
-  X509_STORE_CTX_cleanup (csc);
+  X509_STORE_CTX_free (csc);
   X509_STORE_free (store);
 
   return ret;
diff --git a/tls/openssl/gtlsfiledatabase-openssl.c b/tls/openssl/gtlsfiledatabase-openssl.c
index b194efb..13ab7e9 100644
--- a/tls/openssl/gtlsfiledatabase-openssl.c
+++ b/tls/openssl/gtlsfiledatabase-openssl.c
@@ -602,7 +602,7 @@ g_tls_file_database_openssl_verify_chain (GTlsDatabase             *database,
   x = g_tls_certificate_openssl_get_cert (G_TLS_CERTIFICATE_OPENSSL (chain));
   if (!X509_STORE_CTX_init (csc, store, x, certs))
     {
-      X509_STORE_CTX_cleanup (csc);
+      X509_STORE_CTX_free (csc);
       X509_STORE_free (store);
       sk_X509_free (certs);
       return G_TLS_CERTIFICATE_GENERIC_ERROR;
@@ -616,7 +616,7 @@ g_tls_file_database_openssl_verify_chain (GTlsDatabase             *database,
   if (X509_verify_cert (csc) <= 0)
     result = g_tls_certificate_openssl_convert_error (X509_STORE_CTX_get_error (csc));
 
-  X509_STORE_CTX_cleanup (csc);
+  X509_STORE_CTX_free (csc);
   X509_STORE_free (store);
   sk_X509_free (certs);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]