gnunet-svn
[Top][All Lists]
Advanced

[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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]