[glib-networking/wip/nacho/openssl] openssl: do not leak the peer certificate
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/wip/nacho/openssl] openssl: do not leak the peer certificate
- Date: Tue, 18 Sep 2018 15:10:34 +0000 (UTC)
commit 37cb54ae0a229cad03a51bf81fdd5249216c826e
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]