From b718128b4f3eb8473fb3b31c8397b49854e74ab7 Mon Sep 17 00:00:00 2001 From: Tim Ruehsen Date: Tue, 28 Aug 2012 16:43:52 +0200 Subject: [PATCH] gnutls: deinit gnutls_x509_crt_t --- src/ChangeLog | 4 ++++ src/gnutls.c | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 862ae30f..d5b70f09 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-08-28 Tim Ruehsen + + * gnutls.c (ssl_check_certificate): deinit gnutls_x509_crt_t. + 2012-07-07 Giuseppe Scrivano * html-url.c (cleanup_html_url): Remove "static" modifier. diff --git a/src/gnutls.c b/src/gnutls.c index 32c6d174..69b1cb27 100644 --- a/src/gnutls.c +++ b/src/gnutls.c @@ -515,7 +515,7 @@ ssl_check_certificate (int fd, const char *host) { logprintf (LOG_NOTQUIET, _("No certificate found\n")); success = false; - goto out; + goto crt_deinit; } err = gnutls_x509_crt_import (cert, cert_list, GNUTLS_X509_FMT_DER); if (err < 0) @@ -523,7 +523,7 @@ ssl_check_certificate (int fd, const char *host) logprintf (LOG_NOTQUIET, _("Error parsing certificate: %s\n"), gnutls_strerror (err)); success = false; - goto out; + goto crt_deinit; } if (now < gnutls_x509_crt_get_activation_time (cert)) { @@ -542,6 +542,7 @@ ssl_check_certificate (int fd, const char *host) quote (host)); success = false; } + crt_deinit: gnutls_x509_crt_deinit (cert); } -- 2.39.2