[glib-networking/glib-2-62] gnutls: fix leak of base stream (or base datagram socket)
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib-networking/glib-2-62] gnutls: fix leak of base stream (or base datagram socket)
- Date: Mon, 30 Dec 2019 00:22:00 +0000 (UTC)
commit ef156bb398e1ba1e821277be7e2f993591e39fbc
Author: Michael Catanzaro <mcatanzaro gnome org>
Date: Sun Dec 29 18:19:46 2019 -0600
gnutls: fix leak of base stream (or base datagram socket)
We leak the base GIOStream or GDatagramBased in
g_tls_connection_gnutls_initable_init. Oops.
tls/gnutls/gtlsconnection-gnutls.c | 5 +++++
1 file changed, 5 insertions(+)
---
diff --git a/tls/gnutls/gtlsconnection-gnutls.c b/tls/gnutls/gtlsconnection-gnutls.c
index 2ea627b..166fb33 100644
--- a/tls/gnutls/gtlsconnection-gnutls.c
+++ b/tls/gnutls/gtlsconnection-gnutls.c
@@ -223,6 +223,8 @@ g_tls_connection_gnutls_initable_init (GInitable *initable,
g_set_error (error, G_TLS_ERROR, G_TLS_ERROR_MISC,
_("Could not create TLS connection: %s"),
gnutls_strerror (status));
+ g_clear_object (&base_io_stream);
+ g_clear_object (&base_socket);
return FALSE;
}
@@ -245,6 +247,9 @@ g_tls_connection_gnutls_initable_init (GInitable *initable,
if (flags & GNUTLS_DATAGRAM)
gnutls_dtls_set_mtu (priv->session, 1400);
+ g_clear_object (&base_io_stream);
+ g_clear_object (&base_socket);
+
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]