From 632a56e17e3ac4630e113b80ed89f403883f464f Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 1 Jun 2025 03:23:33 +0000 Subject: Fix resource leaks in ec_points_make_affine() Add missing BN_CTX_end() and free prod_Z. CID 552848 (for prod_Z) --- src/lib/libcrypto/ec/ecp_hp_methods.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/lib/libcrypto/ec/ecp_hp_methods.c b/src/lib/libcrypto/ec/ecp_hp_methods.c index 72df395498..c62334e7c8 100644 --- a/src/lib/libcrypto/ec/ecp_hp_methods.c +++ b/src/lib/libcrypto/ec/ecp_hp_methods.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ecp_hp_methods.c,v 1.2 2025/05/25 05:43:33 jsing Exp $ */ +/* $OpenBSD: ecp_hp_methods.c,v 1.3 2025/06/01 03:23:33 tb Exp $ */ /* * Copyright (c) 2024-2025 Joel Sing * @@ -778,6 +778,9 @@ ec_points_make_affine(const EC_GROUP *group, size_t num, EC_POINT *points[], ret = 1; err: + BN_CTX_end(ctx); + free(prod_Z); + return ret; } #endif -- cgit v1.2.3-55-g6feb