[glib-networking/gtlsconnection-error_leak] GTlsConnectionBase: plug an error leaked



commit 25453b0b47d1acb319e49d578c1be56dc167dea7
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Thu Sep 5 12:53:18 2019 +0300

    GTlsConnectionBase: plug an error leaked
    
    Not all code paths take care of either propagating or clearing my_error,
    so it gets leaked. Fix that in a non-intrusive way.
    
    Valgrind output:
    
    ==3368== 48 (16 direct, 32 indirect) bytes in 1 blocks are definitely lost in loss record 1,490 of 2,432
    ==3368==    at 0x483577F: malloc (vg_replace_malloc.c:309)
    ==3368==    by 0x4961444: g_malloc (gmem.c:99)
    ==3368==    by 0x497C6E6: g_slice_alloc (gslice.c:1024)
    ==3368==    by 0x493FAC3: g_error_new_valist (gerror.c:419)
    ==3368==    by 0x493FEC8: g_set_error (gerror.c:593)
    ==3368==    by 0x4B58986: g_socket_send_with_timeout (gsocket.c:3396)
    ==3368==    by 0x4B58A57: g_socket_send_with_blocking (gsocket.c:3473)
    ==3368==    by 0x4B64FE1: g_socket_output_stream_write (gsocketoutputstream.c:131)
    ==3368==    by 0x4B3EFD4: g_output_stream_write (goutputstream.c:242)
    ==3368==    by 0x4B46A29: g_pollable_stream_write (gpollableutils.c:250)
    ==3368==    by 0x4CC22AE: g_tls_connection_gnutls_push_func (gtlsconnection-gnutls.c:590)

 tls/base/gtlsconnection-base.c | 1 +
 1 file changed, 1 insertion(+)
---
diff --git a/tls/base/gtlsconnection-base.c b/tls/base/gtlsconnection-base.c
index f6b499a..2ff9160 100644
--- a/tls/base/gtlsconnection-base.c
+++ b/tls/base/gtlsconnection-base.c
@@ -786,6 +786,7 @@ g_tls_connection_base_real_pop_io (GTlsConnectionBase  *tls,
           g_set_error_literal (error, G_TLS_ERROR, G_TLS_ERROR_CERTIFICATE_REQUIRED,
                                _("Server required TLS certificate"));
         }
+      g_clear_error (&my_error);
     }
   else if (my_error)
     {


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