diff mbox series

wolfSSL: Fix the memory leak of crypto_ec_point_compute_y_sqr()

Message ID 1e0d1a61.4a81.18041619f51.Coremail.d2014zjt@163.com
State Accepted
Headers show
Series wolfSSL: Fix the memory leak of crypto_ec_point_compute_y_sqr() | expand

Commit Message

MurphyZhao April 19, 2022, 10:32 a.m. UTC
From 545ff6e7b5fa8c4d82a5cd08a1958c8914f9d71f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=86=9B=E6=B6=9B?= <d2014zjt@163.com>
Date: Tue, 19 Apr 2022 17:31:35 +0800
Subject: [PATCH] wolfSSL: Fix the memory leak of
 crypto_ec_point_compute_y_sqr()
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Local variable "t" needs to be cleared whether "calced" is 0 or 1.

Signed-off-by: 赵军涛 <d2014zjt@163.com>
---
 src/crypto/crypto_wolfssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jouni Malinen April 23, 2022, 9:40 p.m. UTC | #1
On Tue, Apr 19, 2022 at 06:32:38PM +0800, MurphyZhao wrote:
> Local variable "t" needs to be cleared whether "calced" is 0 or 1.

Thanks, applied.
diff mbox series

Patch

diff --git a/src/crypto/crypto_wolfssl.c b/src/crypto/crypto_wolfssl.c
index dba4dee82..5dc6ec665 100644
--- a/src/crypto/crypto_wolfssl.c
+++ b/src/crypto/crypto_wolfssl.c
@@ -1676,9 +1676,9 @@  done:
 			mp_clear(y2);
 			os_free(y2);
 		}
-		mp_clear(&t);
 	}
 
+	mp_clear(&t);
 	return (struct crypto_bignum *) y2;
 }