[glib-networking: 122/129] openssl: do not leak the peer certificate
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking: 122/129] openssl: do not leak the peer certificate
- Date: Sat, 2 Feb 2019 22:53:38 +0000 (UTC)
commit 1eb25776c22ed52b9b075a64ec9edde329d6513c
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Sep 18 17:09:41 2018 +0200
openssl: do not leak the peer certificate
tls/openssl/gtlsconnection-openssl.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index fbcb869..d848d5e 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -261,9 +261,13 @@ get_peer_certificate (GTlsConnectionOpenssl *openssl)
certs = SSL_get_peer_cert_chain (ssl);
if (certs == NULL)
- return NULL;
+ {
+ X509_free (peer);
+ return NULL;
+ }
chain = g_tls_certificate_openssl_build_chain (peer, certs);
+ X509_free (peer);
if (!chain)
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]