diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 83256a893..2e7069317 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -11171,8 +11171,10 @@ ecEncCtx* wc_ecc_ctx_new(int flags, WC_RNG* rng) void wc_ecc_ctx_free(ecEncCtx* ctx) { if (ctx) { + void* heap = ctx->heap; ForceZero(ctx, sizeof(ecEncCtx)); - XFREE(ctx, ctx->heap, DYNAMIC_TYPE_ECC); + XFREE(ctx, heap, DYNAMIC_TYPE_ECC); + (void)heap; } }