gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet] 12/28: JSON: fix memory leaks in test.


From: gnunet
Subject: [gnunet] 12/28: JSON: fix memory leaks in test.
Date: Mon, 06 Feb 2023 06:19:14 +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 f7a3ef7b46311a01d5934a52b2fc0962f833a73f
Author: ulfvonbelow <strilen@tilde.club>
AuthorDate: Sun Jan 29 06:49:28 2023 -0600

    JSON: fix memory leaks in test.
    
    This allows us to use sanitizers to find bugs that matter.
    
    Signed-off-by: Martin Schanzenbach <schanzen@gnunet.org>
---
 src/json/test_json.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/json/test_json.c b/src/json/test_json.c
index d6c372cf3..db376d213 100644
--- a/src/json/test_json.c
+++ b/src/json/test_json.c
@@ -141,6 +141,7 @@ test_raw ()
     GNUNET_assert (NULL != j);
     GNUNET_assert (GNUNET_OK == GNUNET_JSON_parse (j, spec, NULL, NULL));
     GNUNET_assert (0 == memcmp (blob, blob2, i));
+    json_decref (j);
   }
   return 0;
 }
@@ -177,6 +178,8 @@ test_rsa ()
   GNUNET_assert (GNUNET_OK == GNUNET_JSON_parse (js, sspec, NULL, NULL));
   GNUNET_break (0 == GNUNET_CRYPTO_rsa_signature_cmp (sig, sig2));
   GNUNET_break (0 == GNUNET_CRYPTO_rsa_public_key_cmp (pub, pub2));
+  json_decref (jp);
+  json_decref (js);
   GNUNET_CRYPTO_rsa_signature_free (sig);
   GNUNET_CRYPTO_rsa_signature_free (sig2);
   GNUNET_CRYPTO_rsa_private_key_free (priv);
@@ -216,6 +219,8 @@ test_boolean ()
 
   GNUNET_assert (GNUNET_OK != GNUNET_JSON_parse (json, pspec, NULL, NULL));
 
+  json_decref (json);
+
   return 0;
 }
 

-- 
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]