From 734f0cf65e630dce5180aa1f08c621f30a10f5c4 Mon Sep 17 00:00:00 2001 From: irwir Date: Thu, 26 Sep 2019 21:03:24 +0300 Subject: [PATCH] Resolve #2800 - move declaration to avoid unused variable warning in case MBEDTLS_SSL_PROTO_DTLS was undefined --- library/ssl_tls.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/ssl_tls.c b/library/ssl_tls.c index ae369b24c..9577b3510 100644 --- a/library/ssl_tls.c +++ b/library/ssl_tls.c @@ -120,7 +120,6 @@ int mbedtls_ssl_check_record( mbedtls_ssl_context const *ssl, size_t buflen ) { int ret = 0; - mbedtls_record rec; MBEDTLS_SSL_DEBUG_MSG( 1, ( "=> mbedtls_ssl_check_record" ) ); MBEDTLS_SSL_DEBUG_BUF( 3, "record buffer", buf, buflen ); @@ -137,6 +136,8 @@ int mbedtls_ssl_check_record( mbedtls_ssl_context const *ssl, #if defined(MBEDTLS_SSL_PROTO_DTLS) else { + mbedtls_record rec; + ret = ssl_parse_record_header( ssl, buf, buflen, &rec ); if( ret != 0 ) {