public inbox for iwd@lists.linux.dev
 help / color / mirror / Atom feed
* [PATCH] unit: fix memory leaks in test-dpp
@ 2021-12-06 23:51 James Prestwood
  0 siblings, 0 replies; 2+ messages in thread
From: James Prestwood @ 2021-12-06 23:51 UTC (permalink / raw)
  To: iwd 

[-- Attachment #1: Type: text/plain, Size: 1392 bytes --]

---
 unit/test-dpp.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/unit/test-dpp.c b/unit/test-dpp.c
index d687bba0..1d4846c7 100644
--- a/unit/test-dpp.c
+++ b/unit/test-dpp.c
@@ -31,6 +31,7 @@
 
 #include "src/dpp-util.h"
 #include "src/util.h"
+#include "ell/useful.h"
 
 /*
  * B.2 Test Vectors for DPP Authentication Using P-256 for
@@ -68,12 +69,13 @@ static void test_key_derivation(const void *data)
 {
 	uint64_t tmp[L_ECC_MAX_DIGITS];
 	const struct l_ecc_curve *curve = l_ecc_curve_from_ike_group(19);
-	struct l_ecc_point *i_proto_public;
-	struct l_ecc_point *r_boot_public;
-	struct l_ecc_scalar *r_boot_private;
-	struct l_ecc_scalar *r_proto_private;
-	struct l_ecc_point *r_proto_public;
-	struct l_ecc_scalar *m, *n;
+	_auto_(l_ecc_point_free) struct l_ecc_point *i_proto_public = NULL;
+	_auto_(l_ecc_point_free) struct l_ecc_point *r_boot_public = NULL;
+	_auto_(l_ecc_scalar_free) struct l_ecc_scalar *r_boot_private = NULL;
+	_auto_(l_ecc_scalar_free) struct l_ecc_scalar *r_proto_private = NULL;
+	_auto_(l_ecc_point_free) struct l_ecc_point *r_proto_public = NULL;
+	_auto_(l_ecc_scalar_free) struct l_ecc_scalar *m = NULL;
+	_auto_(l_ecc_scalar_free) struct l_ecc_scalar *n = NULL;
 	uint64_t k1[L_ECC_MAX_DIGITS];
 	uint64_t k2[L_ECC_MAX_DIGITS];
 	uint64_t ke[L_ECC_MAX_DIGITS];
-- 
2.31.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] unit: fix memory leaks in test-dpp
@ 2021-12-07  0:45 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2021-12-07  0:45 UTC (permalink / raw)
  To: iwd 

[-- Attachment #1: Type: text/plain, Size: 202 bytes --]

Hi James,

On 12/6/21 5:51 PM, James Prestwood wrote:
> ---
>   unit/test-dpp.c | 14 ++++++++------
>   1 file changed, 8 insertions(+), 6 deletions(-)
> 

Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-12-07  0:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-07  0:45 [PATCH] unit: fix memory leaks in test-dpp Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2021-12-06 23:51 James Prestwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox