From 0f26a0d42b4fc9fb06ab3138b36db2bcc69d2cbd Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Tue, 12 Aug 2025 22:51:00 +0200 Subject: lib: Fix memory leaks in tests Fixes memory leaks in the tests that had escaped detection. Signed-off-by: Dimitri Staessens --- src/lib/tests/auth_test.c | 1 + src/lib/tests/crypt_test.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'src/lib/tests') diff --git a/src/lib/tests/auth_test.c b/src/lib/tests/auth_test.c index f0a8899a..a5bf931d 100644 --- a/src/lib/tests/auth_test.c +++ b/src/lib/tests/auth_test.c @@ -511,6 +511,7 @@ int test_auth_bad_signature(void) goto fail_verify; } + freebuf(fake_sig); freebuf(sig); crypt_free_key(pk); diff --git a/src/lib/tests/crypt_test.c b/src/lib/tests/crypt_test.c index 7f011e5c..7489d5b3 100644 --- a/src/lib/tests/crypt_test.c +++ b/src/lib/tests/crypt_test.c @@ -216,6 +216,8 @@ int test_crypt_encrypt_decrypt(void) } crypt_destroy_ctx(ctx); + freebuf(out2); + freebuf(out); TEST_SUCCESS(); -- cgit v1.2.3