mirror of
https://github.com/GothenburgBitFactory/taskwarrior.git
synced 2025-08-20 04:13:07 +02:00
TLSClient: Free error data after extracting error message
This commit is contained in:
parent
60139d24f8
commit
8c1d625a54
1 changed files with 3 additions and 2 deletions
|
@ -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
|
auto status = gnutls_session_get_verify_cert_status (_session); // 3.4.6
|
||||||
gnutls_datum_t out;
|
gnutls_datum_t out;
|
||||||
gnutls_certificate_verification_status_print (status, type, &out, 0); // 3.1.4
|
gnutls_certificate_verification_status_print (status, type, &out, 0); // 3.1.4
|
||||||
gnutls_free (out.data); // All
|
|
||||||
|
|
||||||
std::string error {(const char*) out.data};
|
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
|
#else
|
||||||
throw format ("Handshake failed. {1}", gnutls_strerror (ret)); // All
|
throw format ("Handshake failed. {1}", gnutls_strerror (ret)); // All
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue