[PATCH] wolfSSL: Fix the memory leak of crypto_ec_point_compute_y_sqr()

MurphyZhao d2014zjt at 163.com
Tue Apr 19 03:32:38 PDT 2022


From 545ff6e7b5fa8c4d82a5cd08a1958c8914f9d71f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=B5=B5=E5=86=9B=E6=B6=9B?= <d2014zjt at 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 at 163.com>
---
 src/crypto/crypto_wolfssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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;
 }
 
-- 
2.30.1.windows.1

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-wolfSSL-Fix-the-memory-leak-of-crypto_ec_point_compu.patch
Type: application/octet-stream
Size: 892 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/hostap/attachments/20220419/fab6b382/attachment.obj>


More information about the Hostap mailing list