[glib-networking/wip/openssl] Fix more stack mem leaks



commit bd8b90d68d868af6ac464bab1774c90bd19bb48b
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sun May 22 22:05:03 2016 +0200

    Fix more stack mem leaks

 tls/openssl/gtlscertificate-openssl.c  |    2 ++
 tls/openssl/gtlsfiledatabase-openssl.c |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tls/openssl/gtlscertificate-openssl.c b/tls/openssl/gtlscertificate-openssl.c
index d6af639..a0e4124 100644
--- a/tls/openssl/gtlscertificate-openssl.c
+++ b/tls/openssl/gtlscertificate-openssl.c
@@ -634,6 +634,8 @@ is_issuer (GTlsCertificateOpenssl *cert,
   else
     ret = TRUE;
 
+  sk_X509_free (trusted);
+
 end:
   X509_STORE_CTX_cleanup (&csc);
   X509_STORE_free (store);
diff --git a/tls/openssl/gtlsfiledatabase-openssl.c b/tls/openssl/gtlsfiledatabase-openssl.c
index 7b42d5e..8f906b4 100644
--- a/tls/openssl/gtlsfiledatabase-openssl.c
+++ b/tls/openssl/gtlsfiledatabase-openssl.c
@@ -533,6 +533,7 @@ is_self_signed (GTlsCertificateOpenssl *certificate)
   X509_STORE_CTX_set_flags (&csc, X509_V_FLAG_CHECK_SS_SIGNATURE);
 
   ret = X509_verify_cert (&csc) > 0;
+  sk_X509_free (trusted);
 
 end:
   X509_STORE_CTX_cleanup (&csc);
@@ -791,6 +792,8 @@ g_tls_file_database_openssl_verify_chain (GTlsDatabase             *database,
   X509_STORE_CTX_cleanup (&csc);
   X509_STORE_free (store);
   sk_X509_free (certs);
+  if (anchors)
+    sk_X509_free (anchors);
 
   if (g_cancellable_set_error_if_cancelled (cancellable, error))
     return G_TLS_CERTIFICATE_GENERIC_ERROR;


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