gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 10/28: -HELLO: fix memory leaks in tests.


From: gnunet
Subject: [gnunet] 10/28: -HELLO: fix memory leaks in tests.
Date: Mon, 06 Feb 2023 06:19:12 +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 efad40e99f1d00b41814d9a5ee856a88e1be979e
Author: ulfvonbelow <strilen@tilde.club>
AuthorDate: Sun Jan 29 07:05:06 2023 -0600

    -HELLO: fix memory leaks in tests.
    
    This allows us to use sanitizers to find bugs that matter.
    
    Signed-off-by: Martin Schanzenbach <schanzen@gnunet.org>
---
 src/hello/test_hello-ng.c  | 8 ++++++--
 src/hello/test_hello-uri.c | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/hello/test_hello-ng.c b/src/hello/test_hello-ng.c
index 4ace9439f..ef84e2425 100644
--- a/src/hello/test_hello-ng.c
+++ b/src/hello/test_hello-ng.c
@@ -31,6 +31,7 @@ main (int argc,
   struct GNUNET_PeerIdentity pid;
   struct GNUNET_TIME_Absolute t = GNUNET_TIME_absolute_get ();
   char *res;
+  char *address;
   size_t res_len;
   enum GNUNET_NetworkType nt;
 
@@ -47,10 +48,13 @@ main (int argc,
   GNUNET_log (GNUNET_ERROR_TYPE_MESSAGE,
               "%s\n", res);
   GNUNET_assert (NULL !=
-                 GNUNET_HELLO_extract_address ((void**) res,
+                 (address =
+                  GNUNET_HELLO_extract_address ((void**) res,
                                                res_len,
                                                &pid,
                                                &nt,
-                                               &t));
+                                                &t)));
+  GNUNET_free (address);
+  GNUNET_free (res);
   return 0;
 }
diff --git a/src/hello/test_hello-uri.c b/src/hello/test_hello-uri.c
index 7e70d6763..01b6f2d8e 100644
--- a/src/hello/test_hello-uri.c
+++ b/src/hello/test_hello-uri.c
@@ -207,6 +207,7 @@ main (int argc,
              url);
     GNUNET_free (url);
   }
+  GNUNET_HELLO_builder_free (b);
 
   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]