[glib-networking/mcatanzaro/session-resumption: 20/24] gnutls: fix session data leak



commit 82e6bfbc8d55b70b86463329298de999da46ca04
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Tue Oct 1 19:19:15 2019 -0500

    gnutls: fix session data leak

 tls/gnutls/gtlsclientconnection-gnutls.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/tls/gnutls/gtlsclientconnection-gnutls.c b/tls/gnutls/gtlsclientconnection-gnutls.c
index 31104f1..5e1b76a 100644
--- a/tls/gnutls/gtlsclientconnection-gnutls.c
+++ b/tls/gnutls/gtlsclientconnection-gnutls.c
@@ -482,6 +482,7 @@ g_tls_client_connection_gnutls_complete_handshake (GTlsConnectionBase  *tls,
       if (gnutls_session_get_data2 (g_tls_connection_gnutls_get_session (G_TLS_CONNECTION_GNUTLS (tls)),
                                     &session_datum) == 0)
         {
+          g_clear_pointer (&gnutls->session_data, g_bytes_unref);
           gnutls->session_data = g_bytes_new_with_free_func (session_datum.data,
                                                              session_datum.size,
                                                              (GDestroyNotify)gnutls_free,


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