[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnunet] 21/28: -RECLAIM: fix memory leaks in tests.
From: |
gnunet |
Subject: |
[gnunet] 21/28: -RECLAIM: fix memory leaks in tests. |
Date: |
Mon, 06 Feb 2023 06:19:23 +0100 |
This is an automated email from the git hooks/post-receive script.
martin-schanzenbach pushed a commit to branch master
in repository gnunet.
commit 9719babb53912f2523205238962b91f35359e42b
Author: ulfvonbelow <strilen@tilde.club>
AuthorDate: Sun Jan 29 06:15:57 2023 -0600
-RECLAIM: fix memory leaks in tests.
This makes the sanitizers happy so we can find the bugs that matter.
Signed-off-by: Martin Schanzenbach <schanzen@gnunet.org>
---
src/reclaim/test_did_helper.c | 5 +++++
src/reclaim/test_reclaim_attribute.c | 1 +
2 files changed, 6 insertions(+)
diff --git a/src/reclaim/test_did_helper.c b/src/reclaim/test_did_helper.c
index c7c6f3110..02db28925 100644
--- a/src/reclaim/test_did_helper.c
+++ b/src/reclaim/test_did_helper.c
@@ -69,6 +69,7 @@ test_GNUNET_DID_pkey_to_did ()
char *str_did;
str_did = DID_pkey_to_did (&test_pkey);
GNUNET_assert (strcmp ((char *) test_did, str_did) == 0);
+ GNUNET_free (str_did);
}
void
@@ -93,6 +94,7 @@ test_GNUNET_DID_key_convert_gnunet_to_multibase_base64 ()
multibase_key = DID_key_convert_gnunet_to_multibase_base64 (&test_pkey);
GNUNET_assert (strcmp (test_multibase_key, multibase_key) == 0);
+ GNUNET_free (multibase_key);
}
void
@@ -102,6 +104,8 @@ test_GNUNET_DID_pkey_to_did_document ()
char *did_document_str = DID_pkey_to_did_document (&test_pkey);
did_document = json_loads (did_document_str, JSON_DECODE_ANY, NULL);
GNUNET_assert (json_equal (test_did_document, did_document) == 1);
+ json_decref (did_document);
+ GNUNET_free (did_document_str);
}
int
@@ -128,5 +132,6 @@ main ()
test_GNUNET_DID_did_to_pkey ();
test_GNUNET_DID_pkey_to_did_document ();
test_GNUNET_DID_key_convert_gnunet_to_multibase_base64 ();
+ json_decref (test_did_document);
return 0;
}
diff --git a/src/reclaim/test_reclaim_attribute.c
b/src/reclaim/test_reclaim_attribute.c
index 0740812eb..acbcda62d 100644
--- a/src/reclaim/test_reclaim_attribute.c
+++ b/src/reclaim/test_reclaim_attribute.c
@@ -45,4 +45,5 @@ main (int argc, char *argv[])
//GNUNET_assert (-1 != deser_len);
GNUNET_free (ser_data);
GNUNET_RECLAIM_attribute_list_destroy (al);
+ GNUNET_RECLAIM_attribute_list_destroy (al_two);
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [gnunet] 10/28: -HELLO: fix memory leaks in tests., (continued)
- [gnunet] 10/28: -HELLO: fix memory leaks in tests., gnunet, 2023/02/06
- [gnunet] 27/28: SETU: prevent misaligned access to StrataEstimatorMessage.set_size., gnunet, 2023/02/06
- [gnunet] 23/28: REVOCATION: don't leak signature purpose memory., gnunet, 2023/02/06
- [gnunet] 25/28: SETU: avoid 64-bit shift on 64-bit value., gnunet, 2023/02/06
- [gnunet] 28/28: SETU: don't leak Operation.{message_control_flow,inquiries_sent}., gnunet, 2023/02/06
- [gnunet] 19/28: RECLAIM: fix 1-byte overflow in DID_did_to_pkey., gnunet, 2023/02/06
- [gnunet] 22/28: TESTBED: don't leak helper_argv when SSH can't be executed., gnunet, 2023/02/06
- [gnunet] 24/28: REST: don't leak basic_auth_file., gnunet, 2023/02/06
- [gnunet] 26/28: -SECRETSHARING: don't leak my_share in test., gnunet, 2023/02/06
- [gnunet] 20/28: RECLAIM: don't leak the elements of attr_list., gnunet, 2023/02/06
- [gnunet] 21/28: -RECLAIM: fix memory leaks in tests.,
gnunet <=