From 52cc578d5341f35f9dc3197af4b72720f916a709 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Thu, 7 Jan 2021 16:34:25 +0100 Subject: [HICN-668] Fix various leaks across codebase MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: If08eeebd4ab033e33e15809ad3b1a5cb74e83d90 Signed-off-by: Jordan Augé --- hicn-light/src/hicn/io/udpListener.c | 1 + hicn-light/src/hicn/processor/fib.c | 2 ++ hicn-light/src/hicn/processor/fibEntry.h | 7 ------- hicn-light/src/hicn/processor/messageProcessor.c | 1 + 4 files changed, 4 insertions(+), 7 deletions(-) diff --git a/hicn-light/src/hicn/io/udpListener.c b/hicn-light/src/hicn/io/udpListener.c index 21b4f6190..16e8c8ddf 100644 --- a/hicn-light/src/hicn/io/udpListener.c +++ b/hicn-light/src/hicn/io/udpListener.c @@ -633,6 +633,7 @@ static void _readcb(int fd, PARCEventType what, void * listener_void) { if(readLength < 0) { printf("unable to read the message\n"); + parcMemory_Deallocate(packet); return; } diff --git a/hicn-light/src/hicn/processor/fib.c b/hicn-light/src/hicn/processor/fib.c index 2f4dca9a3..de0d1e2ef 100644 --- a/hicn-light/src/hicn/processor/fib.c +++ b/hicn-light/src/hicn/processor/fib.c @@ -236,6 +236,8 @@ void fib_Add(FIB *fib, FibEntry *entry) { inner_node ->right = curr; } fib->size ++; + + name_Release(&inner_prefix); } FibEntry *fib_Contains(const FIB *fib, const Name *prefix) { diff --git a/hicn-light/src/hicn/processor/fibEntry.h b/hicn-light/src/hicn/processor/fibEntry.h index 9e438b0e6..7a8699165 100644 --- a/hicn-light/src/hicn/processor/fibEntry.h +++ b/hicn-light/src/hicn/processor/fibEntry.h @@ -99,13 +99,6 @@ size_t fibEntry_NexthopCount(const FibEntry *fibEntry); */ const NumberSet *fibEntry_GetNexthops(const FibEntry *fibEntry); -const NumberSet *fibEntry_GetNexthopsFromForwardingStrategy( -#ifdef WITH_POLICY - FibEntry *fibEntry, const Message *interestMessage, bool is_retransmission); -#else - const FibEntry *fibEntry, const Message *interestMessage); -#endif /* WITH_POLICY */ - #ifdef WITH_POLICY void fibEntry_ReceiveObjectMessage(FibEntry *fibEntry, #else diff --git a/hicn-light/src/hicn/processor/messageProcessor.c b/hicn-light/src/hicn/processor/messageProcessor.c index bdd9c23e8..d3f07cbda 100644 --- a/hicn-light/src/hicn/processor/messageProcessor.c +++ b/hicn-light/src/hicn/processor/messageProcessor.c @@ -619,6 +619,7 @@ static bool messageProcessor_ForwardViaFib(MessageProcessor *processor, } } + numberSet_Release(&nexthops); return false; } -- cgit 1.2.3-korg