Skip to content

Commit 7ebad05

Browse files
committed
SSL_free, TLSX_Remove calls: fix #if protection
TLSX_Remove calls added to FreeHanshakeResources() for when TLSX_FreeAll can't be called but TLSX still being used. Fix #if protection to compile in TLSX_Remove calls when available.
1 parent 12ee732 commit 7ebad05

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/internal.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8458,9 +8458,9 @@ void FreeHandshakeResources(WOLFSSL* ssl)
84588458
}
84598459
#endif /* HAVE_PK_CALLBACKS */
84608460

8461-
#if defined(HAVE_TLS_EXTENSIONS) && !defined(HAVE_SNI) && !defined(NO_TLS) && \
8462-
!defined(HAVE_ALPN) && !defined(WOLFSSL_POST_HANDSHAKE_AUTH) && \
8463-
!defined(WOLFSSL_DTLS_CID)
8461+
#if defined(HAVE_TLS_EXTENSIONS) && !defined(NO_TLS)
8462+
#if !defined(HAVE_SNI) && !defined(HAVE_ALPN) && !defined(WOLFSSL_DTLS_CID) && \
8463+
!defined(WOLFSSL_POST_HANDSHAKE_AUTH)
84648464
/* Some extensions need to be kept for post-handshake querying. */
84658465
TLSX_FreeAll(ssl->extensions, ssl->heap);
84668466
ssl->extensions = NULL;
@@ -8474,7 +8474,9 @@ void FreeHandshakeResources(WOLFSSL* ssl)
84748474
TLSX_Remove(&ssl->extensions, TLSX_SUPPORTED_VERSIONS, ssl->heap);
84758475
TLSX_Remove(&ssl->extensions, TLSX_KEY_SHARE, ssl->heap);
84768476
#endif
8477-
#endif
8477+
#endif /* !HAVE_SNI && && !HAVE_ALPN && !WOLFSSL_DTLS_CID &&
8478+
* !WOLFSSL_POST_HANDSHAKE_AUTH */
8479+
#endif /* HAVE_TLS_EXTENSIONS && !NO_TLS */
84788480

84798481
#ifdef WOLFSSL_STATIC_MEMORY
84808482
/* when done with handshake decrement current handshake count */

0 commit comments

Comments
 (0)