fix F-679: HMAC Finup Memory Leak on Update Failure

This commit is contained in:
Daniel Pouzzner
2026-06-12 16:26:13 -05:00
parent 3057314f65
commit cac0f231db
+3 -1
View File
@@ -865,8 +865,10 @@ WC_MAYBE_UNUSED static int km_hmac_finup(struct shash_desc *desc, const u8 *data
int ret = wc_HmacUpdate(ctx->wc_hmac, data, len);
if (ret != 0)
if (ret != 0) {
km_hmac_free_tstate(ctx);
return -EINVAL;
}
return km_hmac_final(desc, out);
}