gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 28/28: SETU: don't leak Operation.{message_control_flow,inquiri


From: gnunet
Subject: [gnunet] 28/28: SETU: don't leak Operation.{message_control_flow,inquiries_sent}.
Date: Mon, 06 Feb 2023 06:19:30 +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 dc550106149e1ac077438354cb6d7d568edede4d
Author: ulfvonbelow <strilen@tilde.club>
AuthorDate: Sun Jan 29 05:37:34 2023 -0600

    SETU: don't leak Operation.{message_control_flow,inquiries_sent}.
    
    Signed-off-by: Martin Schanzenbach <schanzen@gnunet.org>
---
 src/setu/gnunet-service-setu.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/src/setu/gnunet-service-setu.c b/src/setu/gnunet-service-setu.c
index b9dc24dce..f85ddb224 100644
--- a/src/setu/gnunet-service-setu.c
+++ b/src/setu/gnunet-service-setu.c
@@ -1552,6 +1552,16 @@ check_byzantine_bounds (struct Operation *op)
 }
 
 
+static enum GNUNET_GenericReturnValue
+free_values_iter(void *cls,
+                 const struct GNUNET_HashCode *key,
+                 void *value)
+{
+  GNUNET_free (value);
+  return GNUNET_YES;
+}
+
+
 /* FIXME: the destroy logic is a mess and should be cleaned up! */
 
 /**
@@ -1605,6 +1615,19 @@ _GSS_operation_destroy (struct Operation *op)
     GNUNET_CONTAINER_multihashmap32_destroy (op->key_to_element);
     op->key_to_element = NULL;
   }
+  if (NULL != op->message_control_flow)
+  {
+    GNUNET_CONTAINER_multihashmap_iterate (op->message_control_flow,
+                                           &free_values_iter,
+                                           NULL);
+    GNUNET_CONTAINER_multihashmap_destroy (op->message_control_flow);
+    op->message_control_flow = NULL;
+  }
+  if (NULL != op->inquiries_sent)
+  {
+    GNUNET_CONTAINER_multihashmap_destroy (op->inquiries_sent);
+    op->inquiries_sent = NULL;
+  }
   if (NULL != set)
   {
     GNUNET_CONTAINER_DLL_remove (set->ops_head,

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