[glib-networking/mcatanzaro/base-rebase: 38/38] Do not leak peer certificate on gnutls
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/mcatanzaro/base-rebase: 38/38] Do not leak peer certificate on gnutls
- Date: Fri, 10 May 2019 12:21:10 +0000 (UTC)
commit f9f633c7639d66254aafc47b9613a26fa94792ed
Author: Ignacio Casal Quinteiro <qignacio amazon com>
Date: Fri May 10 11:49:30 2019 +0200
Do not leak peer certificate on gnutls
tls/base/gtlsconnection-base.c | 1 +
tls/openssl/gtlsconnection-openssl.c | 2 +-
2 files changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index e2bf206..bf8d8ad 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -1221,6 +1221,7 @@ update_peer_certificate_and_compute_errors (GTlsConnectionBase *tls)
g_set_object (&priv->peer_certificate, peer_certificate);
priv->peer_certificate_errors = peer_certificate_errors;
+ g_object_unref (peer_certifiate);
g_object_notify (G_OBJECT (tls), "peer-certificate");
g_object_notify (G_OBJECT (tls), "peer-certificate-errors");
diff --git a/tls/openssl/gtlsconnection-openssl.c b/tls/openssl/gtlsconnection-openssl.c
index ae999e3..eed8c25 100644
--- a/tls/openssl/gtlsconnection-openssl.c
+++ b/tls/openssl/gtlsconnection-openssl.c
@@ -254,7 +254,7 @@ g_tls_connection_openssl_retrieve_peer_certificate (GTlsConnectionBase *tls)
priv = g_tls_connection_openssl_get_instance_private (openssl);
- return priv->peer_certificate;
+ return g_object_ref (priv->peer_certificate);
}
static int
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]