From 67d8c7999ac723cb4edc5cd538918c8f8fcb85ff Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 5 May 2010 19:39:29 +0000 Subject: [PATCH] Free NAT entries on remove (fixes a memory leak) --- src/core/ipv4/ip_nat.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/ipv4/ip_nat.c b/src/core/ipv4/ip_nat.c index ac1ab1a6..eb291558 100644 --- a/src/core/ipv4/ip_nat.c +++ b/src/core/ipv4/ip_nat.c @@ -43,7 +43,6 @@ * them. * * - netif_remove must notify NAT code when a NAT'ed interface is removed - * - free NAT entries on remove? * - allocate NAT entries from a new memp pool instead of the heap * - let ttl be ticks, not seconds * @@ -294,8 +293,8 @@ ip_nat_remove(const ip_nat_entry_t *remove_entry) LWIP_ASSERT("NULL != previous", NULL != previous); previous->next = next; } - /* @todo: free 'cur' or there will be a memory leak !?! */ - /* ip_nat_free(cur); */ + /* free 'cur' or there will be a memory leak */ + ip_nat_free(cur); return; } else { previous = cur;