From a9a7f4c36804d0a5acc5788cf2ef9f39954cccb4 Mon Sep 17 00:00:00 2001 From: michele papalini Date: Tue, 22 Oct 2019 16:19:20 +0200 Subject: [HICN-347] memory leak in messageProcessor_Tick Signed-off-by: michele papalini Change-Id: I9da21006b9c6b44790c5984e0d6e10cc4ade5b1b --- hicn-light/src/hicn/processor/messageProcessor.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'hicn-light') diff --git a/hicn-light/src/hicn/processor/messageProcessor.c b/hicn-light/src/hicn/processor/messageProcessor.c index 3ca9264b8..6598b9035 100644 --- a/hicn-light/src/hicn/processor/messageProcessor.c +++ b/hicn-light/src/hicn/processor/messageProcessor.c @@ -131,16 +131,18 @@ static void messageProcessor_ForwardToInterfaceId(MessageProcessor *processor, static void messageProcessor_Tick(int fd, PARCEventType type, void *user_data) { - MessageProcessor *processor = (MessageProcessor*)user_data; - uint64_t now = (uint64_t)forwarder_GetTicks(processor->forwarder); + MessageProcessor *processor = (MessageProcessor*)user_data; + uint64_t now = (uint64_t)forwarder_GetTicks(processor->forwarder); - /* Loop over FIB entries to compute statistics from counters */ - FibEntryList *fibList = forwarder_GetFibEntries(processor->forwarder); + /* Loop over FIB entries to compute statistics from counters */ + FibEntryList *fibList = forwarder_GetFibEntries(processor->forwarder); - for (size_t i = 0; i < fibEntryList_Length(fibList); i++) { - FibEntry *entry = (FibEntry *)fibEntryList_Get(fibList, i); - fibEntry_UpdateStats(entry, now); - } + for (size_t i = 0; i < fibEntryList_Length(fibList); i++) { + FibEntry *entry = (FibEntry *)fibEntryList_Get(fibList, i); + fibEntry_UpdateStats(entry, now); + } + + fibEntryList_Destroy(&fibList); } #endif /* WITH_POLICY */ -- cgit 1.2.3-korg