From 4a27ba8bce0585d03231683622f66d24d0345a83 Mon Sep 17 00:00:00 2001 From: Tomas Babej Date: Sat, 18 Feb 2017 20:19:03 +0100 Subject: [PATCH] TLSClient: Free error data after extracting error message --- src/TLSClient.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/TLSClient.cpp b/src/TLSClient.cpp index 4bf9026be..b82407d21 100644 --- a/src/TLSClient.cpp +++ b/src/TLSClient.cpp @@ -292,10 +292,11 @@ void TLSClient::connect (const std::string& host, const std::string& port) auto status = gnutls_session_get_verify_cert_status (_session); // 3.4.6 gnutls_datum_t out; gnutls_certificate_verification_status_print (status, type, &out, 0); // 3.1.4 - gnutls_free (out.data); // All std::string error {(const char*) out.data}; - throw format ("Handshake failed. {1}", error); + gnutls_free (out.data); // All + + throw format ("Handshake failed. {1}", error); // All } #else throw format ("Handshake failed. {1}", gnutls_strerror (ret)); // All