Skip to content

gnutls: Fix potential leak

Patrick Griffis requested to merge pgriffis/gnutls-leak into master

Found by LeakSanitizer:

==1055==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 104 byte(s) in 1 object(s) allocated from:
    #0 0x7f3fb1480af7 in calloc (/lib64/libasan.so.6+0xaeaf7)
    #1 0x7f3fb0d46581 in gnutls_privkey_init (/lib64/libgnutls.so.30+0x78581)
    #2 0x7f3fad3e8917 in g_tls_connection_gnutls_handshake_thread_get_certificate ../tls/gnutls/gtlsconnection-gnutls.c:365
    #3 0x7f3fad3e74b7 in g_tls_client_connection_gnutls_handshake_thread_retrieve_function ../tls/gnutls/gtlsclientconnection-gnutls.c:426
    #4 0x7f3fb0d31c84 in call_legacy_cert_cb2 (/lib64/libgnutls.so.30+0x63c84)
    #5 0x7f3fb0dec243 in call_get_cert_callback (/lib64/libgnutls.so.30+0x11e243)
    #6 0x7f3fb0dec514 in _gnutls_select_client_cert (/lib64/libgnutls.so.30+0x11e514)
    #7 0x7f3fb0d631da in _gnutls13_recv_certificate_request_int (/lib64/libgnutls.so.30+0x951da)
    #8 0x7f3fb0d634b0 in _gnutls13_recv_certificate_request (/lib64/libgnutls.so.30+0x954b0)
    #9 0x7f3fb0d0db27 in _gnutls13_handshake_client (/lib64/libgnutls.so.30+0x3fb27)
    #10 0x7f3fb0d19199 in gnutls_handshake (/lib64/libgnutls.so.30+0x4b199)
    #11 0x7f3fad3e9d67 in g_tls_connection_gnutls_handshake_thread_handshake ../tls/gnutls/gtlsconnection-gnutls.c:959
    #12 0x7f3fad3f1b25 in handshake_thread ../tls/base/gtlsconnection-base.c:1561
    #13 0x7f3fad3f2894 in async_handshake_thread ../tls/base/gtlsconnection-base.c:1846
    #14 0x7f3fb0f8f093 in g_task_thread_pool_thread ../gio/gtask.c:1430
    #15 0x7f3fb1191c53 in g_thread_pool_thread_proxy ../glib/gthreadpool.c:354
    #16 0x7f3fb119139c in g_thread_proxy ../glib/gthread.c:827
    #17 0x7f3fb0b5e196 in start_thread (/lib64/libc.so.6+0x8d196)
    #18 0x7f3fb0be3e93 in __GI___clone (/lib64/libc.so.6+0x112e93)

Merge request reports