gnunet-svn
[Top][All Lists]
Advanced

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

[gnunet] 02/28: NAT: don't leak AddrEntries when unregistering.


From: gnunet
Subject: [gnunet] 02/28: NAT: don't leak AddrEntries when unregistering.
Date: Mon, 06 Feb 2023 06:19:04 +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 a3cc7ff4796e32ddfa13f22307877d4f52a7cd58
Author: ulfvonbelow <strilen@tilde.club>
AuthorDate: Sun Jan 29 06:21:24 2023 -0600

    NAT: don't leak AddrEntries when unregistering.
    
    Signed-off-by: Martin Schanzenbach <schanzen@gnunet.org>
---
 src/nat/nat_api.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/src/nat/nat_api.c b/src/nat/nat_api.c
index 3072cff7f..31f8f388d 100644
--- a/src/nat/nat_api.c
+++ b/src/nat/nat_api.c
@@ -673,6 +673,9 @@ GNUNET_NAT_request_reversal (struct GNUNET_NAT_Handle *nh,
 void
 GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh)
 {
+  struct AddrEntry *ae;
+  struct AddrEntry *next;
+
   if (NULL != nh->mq)
   {
     GNUNET_MQ_destroy (nh->mq);
@@ -683,6 +686,14 @@ GNUNET_NAT_unregister (struct GNUNET_NAT_Handle *nh)
     GNUNET_SCHEDULER_cancel (nh->reconnect_task);
     nh->reconnect_task = NULL;
   }
+  next = nh->ae_head;
+  while (NULL != next)
+  {
+    ae = next;
+    next = next->next;
+    GNUNET_CONTAINER_DLL_remove (nh->ae_head, nh->ae_tail, ae);
+    GNUNET_free (ae);
+  }
   GNUNET_free (nh->reg);
   GNUNET_free (nh);
 }

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