From 7977a605c5c4bf78d0af9e02f9d9ee676cc15cf5 Mon Sep 17 00:00:00 2001 From: Daniel Pouzzner Date: Fri, 20 Jun 2025 15:04:07 -0500 Subject: [PATCH] src/internal.c: in FreeSskeArgs(), move nullness check on args to the start, and make it unconditional, to resolve nullPointerRedundantChecks. --- src/internal.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/internal.c b/src/internal.c index 0edd4f226..befbd0a40 100644 --- a/src/internal.c +++ b/src/internal.c @@ -35719,6 +35719,9 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, (void)ssl; + if (args == NULL) + return; + #if defined(HAVE_ECC) || defined(HAVE_CURVE25519) || defined(HAVE_CURVE448) XFREE(args->exportBuf, ssl->heap, DYNAMIC_TYPE_DER); args->exportBuf = NULL; @@ -35728,16 +35731,10 @@ static int DoSessionTicket(WOLFSSL* ssl, const byte* input, word32* inOutIdx, args->verifySig = NULL; #endif - if ( - #ifdef WOLFSSL_ASYNC_IO - args != NULL && - #endif - args->input != NULL) { + if (args->input != NULL) { XFREE(args->input, ssl->heap, DYNAMIC_TYPE_IN_BUFFER); args->input = NULL; } - - (void)args; } /* handle generation of server_key_exchange (12) */