summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Swiften/TLS/OpenSSL/OpenSSLContext.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
index cd6b6bc..0805917 100644
--- a/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
+++ b/Swiften/TLS/OpenSSL/OpenSSLContext.cpp
@@ -123,2 +123,8 @@ void OpenSSLContext::connect() {
handle_ = SSL_new(context_);
+ if (handle_ == nullptr) {
+ state_ = Error;
+ onError(std::make_shared<TLSError>());
+ return;
+ }
+
// Ownership of BIOs is ransferred