diff options
author | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-12 22:51:00 +0200 |
---|---|---|
committer | Dimitri Staessens <dimitri@ouroboros.rocks> | 2025-08-15 11:47:59 +0200 |
commit | 0f26a0d42b4fc9fb06ab3138b36db2bcc69d2cbd (patch) | |
tree | 1c21dee481784cb3296f99bb8f4f0c2c90938c4e | |
parent | 23603e2d74298d0fd4df9858003ad3b7798f0254 (diff) | |
download | ouroboros-0f26a0d42b4fc9fb06ab3138b36db2bcc69d2cbd.tar.gz ouroboros-0f26a0d42b4fc9fb06ab3138b36db2bcc69d2cbd.zip |
lib: Fix memory leaks in tests
Fixes memory leaks in the tests that had escaped detection.
Signed-off-by: Dimitri Staessens <dimitri@ouroboros.rocks>
-rw-r--r-- | src/irmd/tests/oap_test.c | 2 | ||||
-rw-r--r-- | src/lib/tests/auth_test.c | 1 | ||||
-rw-r--r-- | src/lib/tests/crypt_test.c | 2 |
3 files changed, 5 insertions, 0 deletions
diff --git a/src/irmd/tests/oap_test.c b/src/irmd/tests/oap_test.c index e9f67505..2e27762d 100644 --- a/src/irmd/tests/oap_test.c +++ b/src/irmd/tests/oap_test.c @@ -160,6 +160,7 @@ static int test_oap_hdr_init_fini_data(void) goto fail_req_hdr_sz; } + freebuf(data); oap_hdr_fini(&oap_hdr); TEST_SUCCESS(); @@ -232,6 +233,7 @@ static int test_oap_hdr_init_fini_signed(void) crypt_free_crt(pubcrt2); crypt_free_crt(pubcrt); crypt_free_key(pk); + crypt_free_key(pkp); TEST_SUCCESS(); 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(); |