gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] branch master updated (10a1edb89 -> 8d2d6afe5)


From: gnunet
Subject: [gnunet] branch master updated (10a1edb89 -> 8d2d6afe5)
Date: Mon, 13 May 2024 10:51:37 +0200

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

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

    from 10a1edb89 cadet: fix memory leak in announce_id in 
gnunet-service-cadet.
     new 9e211bf9e build system: only try installing hooks if .git directory 
exists.
     new 613cc0cb6 peerstore: fix Iteration memory leak in 
gnunet-service-peerstore.
     new 83d66a87e setu: fix memory leak in strata_estimator_destroy.
     new 7fe3bf1bc topology: fix memory leak in gnunet-daemon-topology.
     new 41c14edbe dht: remove vestigial GNUNET_PLUGIN_unload.
     new 172541409 transport: clean up SharedSecrets in gnunet-communicator-udp.
     new 8d2d6afe5 transport: fix memory leak in extract_address in tcp 
communicator.

The 7 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 bootstrap                                               |  5 ++++-
 src/service/dht/gnunet-service-dht.c                    |  7 -------
 src/service/peerstore/gnunet-service-peerstore.c        | 17 ++++++++++++-----
 src/service/setu/gnunet-service-setu_strata_estimator.c |  8 ++++++++
 src/service/topology/gnunet-daemon-topology.c           |  1 +
 src/service/transport/gnunet-communicator-tcp.c         |  4 +---
 src/service/transport/gnunet-communicator-udp.c         | 13 ++++++++++++-
 7 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/bootstrap b/bootstrap
index d5bf30af4..fb47649a7 100755
--- a/bootstrap
+++ b/bootstrap
@@ -136,7 +136,10 @@ main()
       check_libtool
     fi
     pogen
-    install_hooks
+    if test -d .git
+    then
+        install_hooks
+    fi
 }
 
 main "$@"
diff --git a/src/service/dht/gnunet-service-dht.c 
b/src/service/dht/gnunet-service-dht.c
index ab9e179bc..4579bfc2b 100644
--- a/src/service/dht/gnunet-service-dht.c
+++ b/src/service/dht/gnunet-service-dht.c
@@ -79,11 +79,6 @@ struct GDS_Underlay
    * Name of the underlay (i.e. "gnunet" or "ip").
    */
   char *name;
-
-  /**
-   * Name of the library providing the underlay.
-   */
-  char *libname;
 };
 
 
@@ -383,8 +378,6 @@ shutdown_task (void *cls)
 
   while (NULL != (u = u_head))
   {
-    GNUNET_PLUGIN_unload (u->libname,
-                          u->dhtu);
     GNUNET_CONTAINER_DLL_remove (u_head,
                                  u_tail,
                                  u);
diff --git a/src/service/peerstore/gnunet-service-peerstore.c 
b/src/service/peerstore/gnunet-service-peerstore.c
index 5d0f037a1..3eb224ae8 100644
--- a/src/service/peerstore/gnunet-service-peerstore.c
+++ b/src/service/peerstore/gnunet-service-peerstore.c
@@ -491,6 +491,15 @@ iterate_proc (void *cls,
   proc->limit--;
 }
 
+
+static void destroy_iteration(struct Iteration *ic)
+{
+  GNUNET_free (ic->key);
+  GNUNET_free (ic->sub_system);
+  GNUNET_free (ic);
+}
+
+
 /**
  * Function called once we are done with the iteration and
  * allow the zone iteration client to send us more messages.
@@ -512,10 +521,8 @@ iteration_done_client_continue (struct Iteration *ic)
   endmsg->rid = htons (ic->request_id);
   endmsg->result = htonl (GNUNET_OK);
   GNUNET_MQ_send (ic->pc->mq, env);
-  GNUNET_free (ic->key);
-  GNUNET_free (ic->sub_system);
   GNUNET_CONTAINER_DLL_remove (ic->pc->op_head, ic->pc->op_tail, ic);
-  GNUNET_free (ic);
+  destroy_iteration (ic);
   return;
 }
 
@@ -657,7 +664,7 @@ handle_iterate_stop (void *cls,
     return;
   }
   GNUNET_CONTAINER_DLL_remove (pc->op_head, pc->op_tail, ic);
-  GNUNET_free (ic);
+  destroy_iteration (ic);
   GNUNET_SERVICE_client_continue (pc->client);
 }
 
@@ -1098,7 +1105,7 @@ client_disconnect_cb (void *cls,
   while (NULL != (iter = pc->op_head))
   {
     GNUNET_CONTAINER_DLL_remove (pc->op_head, pc->op_tail, iter);
-    GNUNET_free (iter);
+    destroy_iteration (iter);
   }
   GNUNET_free (pc);
 }
diff --git a/src/service/setu/gnunet-service-setu_strata_estimator.c 
b/src/service/setu/gnunet-service-setu_strata_estimator.c
index 43ccf3afd..e5af92980 100644
--- a/src/service/setu/gnunet-service-setu_strata_estimator.c
+++ b/src/service/setu/gnunet-service-setu_strata_estimator.c
@@ -331,6 +331,12 @@ strata_estimator_create (unsigned int strata_count,
                     "Failed to allocate memory for strata estimator\n");
         for (j = 0; j < i; j++)
           ibf_destroy (se->stratas[strata_ctr]->strata[i]);
+        for (j = 0; j <= strata_ctr; j++)
+        {
+          GNUNET_free (se->stratas[j]->strata);
+          GNUNET_free (se->stratas[j]);
+        }
+        GNUNET_free (se->stratas);
         GNUNET_free (se);
         return NULL;
       }
@@ -463,6 +469,8 @@ strata_estimator_destroy (struct MultiStrataEstimator *se)
     for (i = 0; i < se->stratas[strata_ctr]->strata_count; i++)
       ibf_destroy (se->stratas[strata_ctr]->strata[i]);
     GNUNET_free (se->stratas[strata_ctr]->strata);
+    GNUNET_free (se->stratas[strata_ctr]);
   }
+  GNUNET_free (se->stratas);
   GNUNET_free (se);
 }
diff --git a/src/service/topology/gnunet-daemon-topology.c 
b/src/service/topology/gnunet-daemon-topology.c
index 159ba2a07..a95b67908 100644
--- a/src/service/topology/gnunet-daemon-topology.c
+++ b/src/service/topology/gnunet-daemon-topology.c
@@ -699,6 +699,7 @@ consider_for_advertising (const struct GNUNET_MessageHeader 
*hello)
     GNUNET_HELLO_builder_iterate (builder_old,
                                   &address_iterator,
                                   &num_addresses_old);
+    GNUNET_HELLO_builder_free (builder_old);
     if (GNUNET_TIME_absolute_cmp (new_hello_exp, >, now) &&
         (GNUNET_TIME_absolute_cmp (new_hello_exp, >, old_hello_exp) ||
          num_addresses_old < num_addresses_new))
diff --git a/src/service/transport/gnunet-communicator-tcp.c 
b/src/service/transport/gnunet-communicator-tcp.c
index f8ea14cc7..02f5fc9f9 100644
--- a/src/service/transport/gnunet-communicator-tcp.c
+++ b/src/service/transport/gnunet-communicator-tcp.c
@@ -2369,7 +2369,6 @@ extract_address (const char *bindto)
   char *token;
   char *cp;
   char *rest = NULL;
-  char *res;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
               "extract address with bindto %s\n",
@@ -2402,8 +2401,7 @@ extract_address (const char *bindto)
     else
     {
       token++;
-      res = GNUNET_strdup (token);
-      addr = GNUNET_strdup (res);
+      addr = GNUNET_strdup (token);
     }
   }
 
diff --git a/src/service/transport/gnunet-communicator-udp.c 
b/src/service/transport/gnunet-communicator-udp.c
index 1e6e5bdc3..fa5294218 100644
--- a/src/service/transport/gnunet-communicator-udp.c
+++ b/src/service/transport/gnunet-communicator-udp.c
@@ -883,6 +883,8 @@ bi_destroy (struct BroadcastInterface *bi)
   GNUNET_free (bi);
 }
 
+static int
+secret_destroy (struct SharedSecret *ss);
 
 /**
  * Destroys a receiving state due to timeout or shutdown.
@@ -892,7 +894,7 @@ bi_destroy (struct BroadcastInterface *bi)
 static void
 receiver_destroy (struct ReceiverAddress *receiver)
 {
-
+  struct SharedSecret *ss;
   receiver->receiver_destroy_called = GNUNET_YES;
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
@@ -923,6 +925,10 @@ receiver_destroy (struct ReceiverAddress *receiver)
                          "# receivers active",
                          GNUNET_CONTAINER_multihashmap_size (receivers),
                          GNUNET_NO);
+  while (NULL != (ss = receiver->ss_head))
+  {
+    secret_destroy (ss);
+  }
   GNUNET_free (receiver->address);
   GNUNET_free (receiver->foreign_addr);
   GNUNET_free (receiver);
@@ -1070,6 +1076,7 @@ secret_destroy (struct SharedSecret *ss)
 static void
 sender_destroy (struct SenderAddress *sender)
 {
+  struct SharedSecret *ss;
   sender->sender_destroy_called = GNUNET_YES;
   GNUNET_assert (
     GNUNET_YES ==
@@ -1079,6 +1086,10 @@ sender_destroy (struct SenderAddress *sender)
                          "# senders active",
                          GNUNET_CONTAINER_multihashmap_size (senders),
                          GNUNET_NO);
+  while (NULL != (ss = sender->ss_head))
+  {
+    secret_destroy (ss);
+  }
   GNUNET_free (sender->address);
   GNUNET_free (sender);
 }

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