diff --git a/src/x509.c b/src/x509.c index ccdb50d4cd..f6a790a19f 100644 --- a/src/x509.c +++ b/src/x509.c @@ -1565,11 +1565,9 @@ int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out, WOLFSSL_X509_EXTENSION *ext, { char* asn1str; asn1str = wolfSSL_i2s_ASN1_STRING(NULL, str); - if ((tmpLen = XSNPRINTF( - tmp, tmpSz, "%*s%s", indent, "", asn1str)) - >= tmpSz) - return rc; + tmpLen = XSNPRINTF(tmp, tmpSz, "%*s%s", indent, "", asn1str); XFREE(asn1str, NULL, DYNAMIC_TYPE_TMP_BUFFER); + if (tmpLen >= tmpSz) return rc; break; } case AUTH_INFO_OID: diff --git a/wolfssl/test.h b/wolfssl/test.h index 859e44b131..5d7974b245 100644 --- a/wolfssl/test.h +++ b/wolfssl/test.h @@ -3488,6 +3488,7 @@ static WC_INLINE int myVerifyDecryptCb(WOLFSSL* ssl, static WC_INLINE void SetupAtomicUser(WOLFSSL_CTX* ctx, WOLFSSL* ssl) { +#if !defined(NO_HMAC) && !defined(NO_AES) && defined(HAVE_AES_CBC) AtomicEncCtx* encCtx; AtomicDecCtx* decCtx; @@ -3503,7 +3504,6 @@ static WC_INLINE void SetupAtomicUser(WOLFSSL_CTX* ctx, WOLFSSL* ssl) } XMEMSET(decCtx, 0, sizeof(AtomicDecCtx)); -#if !defined(NO_HMAC) && !defined(NO_AES) && defined(HAVE_AES_CBC) wolfSSL_CTX_SetMacEncryptCb(ctx, myMacEncryptCb); wolfSSL_SetMacEncryptCtx(ssl, encCtx); @@ -3539,7 +3539,7 @@ static WC_INLINE void FreeAtomicUser(WOLFSSL* ssl) if (decCtx != NULL) { if (decCtx->keySetup == 1) wc_AesFree(&decCtx->aes); - free(decCtx); + free(decCtx); } }