diff --git a/libfreerdp/core/transport.c b/libfreerdp/core/transport.c index f47cf4b59..1164caf5d 100644 --- a/libfreerdp/core/transport.c +++ b/libfreerdp/core/transport.c @@ -74,6 +74,9 @@ BOOL transport_disconnect(rdpTransport* transport) { BOOL status = TRUE; + if (!transport) + return FALSE; + if (transport->layer == TRANSPORT_LAYER_TLS) status &= tls_disconnect(transport->TlsIn); diff --git a/libfreerdp/crypto/tls.c b/libfreerdp/crypto/tls.c index 1b5c92ab8..3b97486b5 100644 --- a/libfreerdp/crypto/tls.c +++ b/libfreerdp/crypto/tls.c @@ -360,6 +360,9 @@ BOOL tls_accept(rdpTls* tls, const char* cert_file, const char* privatekey_file) BOOL tls_disconnect(rdpTls* tls) { + if (!tls) + return FALSE; + if (tls->ssl) SSL_shutdown(tls->ssl);