gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 04/04: hello/nat: more coverity fixes


From: gnunet
Subject: [gnunet] 04/04: hello/nat: more coverity fixes
Date: Fri, 30 Aug 2024 08:32:29 +0200

This is an automated email from the git hooks/post-receive script.

martin-schanzenbach pushed a commit to branch master
in repository gnunet.

commit b8d13c6a68e7559f4a41008f0530c7e61cccd64b
Author: Martin Schanzenbach <schanzen@gnunet.org>
AuthorDate: Fri Aug 30 08:32:19 2024 +0200

    hello/nat: more coverity fixes
---
 src/lib/util/nat.c     | 13 ++++++++++---
 src/lib/util/service.c |  3 +++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/src/lib/util/nat.c b/src/lib/util/nat.c
index 7872c9ba9..70e4c8032 100644
--- a/src/lib/util/nat.c
+++ b/src/lib/util/nat.c
@@ -389,6 +389,8 @@ read_send (void *cls)
                 address);
     GNUNET_assert (0);
   }
+  GNUNET_free (address);
+  address = NULL;
   GNUNET_asprintf (&bind_address,
                    "%s:%u",
                    sock_info->bind_address,
@@ -405,6 +407,8 @@ read_send (void *cls)
                 bind_address);
     GNUNET_assert (0);
   }
+  GNUNET_free (bind_address);
+  bind_address = NULL;
   udp_sock =
     GNUNET_NETWORK_socket_create (bind_in->sa_family,
                                   SOCK_DGRAM,
@@ -417,6 +421,7 @@ read_send (void *cls)
                 GNUNET_a2s (bind_in,
                             bind_in_len),
                 in->sa_family);
+    GNUNET_free (bind_in);
     if (EMFILE == errno)
     {
       GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -425,6 +430,9 @@ read_send (void *cls)
       read_send_task = GNUNET_SCHEDULER_add_delayed (again,
                                                      &read_send,
                                                      sock_info);
+      GNUNET_free (si);
+      GNUNET_free (in);
+      GNUNET_free (bind_in);
       return;
     }
     GNUNET_free (sock_info);
@@ -483,10 +491,9 @@ read_send (void *cls)
   }
 
 next_port:
+  GNUNET_free (si);
   GNUNET_free (in);
   GNUNET_free (bind_in);
-  GNUNET_free (address);
-  GNUNET_free (bind_address);
 
   if (65535 == udp_port)
     return;
@@ -502,7 +509,7 @@ struct GNUNET_SCHEDULER_Task *
 GNUNET_get_udp_socket (struct GNUNET_UdpSocketInfo *sock_info,
                        GNUNET_NotifyUdpSocket nus)
 {
-  struct GNUNET_BurstMessage bm;
+  struct GNUNET_BurstMessage bm = {0};
   struct GNUNET_UdpSocketInfo *si = GNUNET_new (struct GNUNET_UdpSocketInfo);
   char dgram[sizeof (struct GNUNET_BurstMessage)];
   char *address;
diff --git a/src/lib/util/service.c b/src/lib/util/service.c
index ffe8f8b00..3f050e2bd 100644
--- a/src/lib/util/service.c
+++ b/src/lib/util/service.c
@@ -1557,7 +1557,10 @@ setup_service (struct GNUNET_SERVICE_Handle *sh)
 
     num = get_server_addresses (sh->service_name, sh->cfg, &addrs, &addrlens);
     if (GNUNET_SYSERR == num)
+    {
+      GNUNET_free (csocks);
       return GNUNET_SYSERR;
+    }
 
     for (int i = 0; i < num; i++)
     {

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