From 8bcb23593eac83501b6fa5b2bcae18ce011103c7 Mon Sep 17 00:00:00 2001 From: Harry Sintonen Date: Sun, 1 Nov 2020 23:32:15 +0200 Subject: [PATCH] gnutls: fix memory leaks (certfields memory wasn't released) Closes #6153 --- lib/vtls/gtls.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/vtls/gtls.c b/lib/vtls/gtls.c index ec3f8599b..b2febaa9e 100644 --- a/lib/vtls/gtls.c +++ b/lib/vtls/gtls.c @@ -1225,13 +1225,18 @@ gtls_connect_step3(struct connectdata *conn, certclock = gnutls_x509_crt_get_expiration_time(x509_cert); showtime(data, "expire date", certclock); + + gnutls_free(certfields.data); } rc = gnutls_x509_crt_get_issuer_dn2(x509_cert, &certfields); if(rc) infof(data, "Failed to get certificate issuer\n"); - else + else { infof(data, "\t issuer: %s\n", certfields.data); + + gnutls_free(certfields.data); + } #endif gnutls_x509_crt_deinit(x509_cert);