[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.
- [gnunet] branch master updated (d8cbbb5b6 -> dc5501061), gnunet, 2023/02/06
- [gnunet] 01/28: -Fix -Wstacl-protector typo., gnunet, 2023/02/06
- [gnunet] 02/28: NAT: don't leak AddrEntries when unregistering.,
gnunet <=
- [gnunet] 03/28: -Miscellaneous mostly-comment typo fixes., gnunet, 2023/02/06
- [gnunet] 04/28: -CORE: fix memory leak in test., gnunet, 2023/02/06
- [gnunet] 08/28: -GNS: use proper config file name in test_proxy.sh., gnunet, 2023/02/06
- [gnunet] 11/28: HELLO: fix memory leak in GNUNET_HELLO_extract_address., gnunet, 2023/02/06
- [gnunet] 17/28: PEERSTORE: fix write-after-free in handle_{iterate_end,watch_record}, gnunet, 2023/02/06
- [gnunet] 18/28: RECLAIM: rename G_D_key_covert_... to G_D_key_convert_..., gnunet, 2023/02/06
- [gnunet] 12/28: JSON: fix memory leaks in test., gnunet, 2023/02/06
- [gnunet] 06/28: DHT: remove "memory leak" in gnunet-dht-{get,put}., gnunet, 2023/02/06
- [gnunet] 05/28: -DATACACHE: fix memory leaks in tests., gnunet, 2023/02/06
- [gnunet] 07/28: FS: fix memory leak in GNUNET_FS_search_stop., gnunet, 2023/02/06