summaryrefslogtreecommitdiffstats
path: root/hicn-light
diff options
context:
space:
mode:
authormichele papalini <micpapal@cisco.com>2019-10-22 16:19:20 +0200
committermichele papalini <micpapal@cisco.com>2019-10-22 16:19:20 +0200
commita9a7f4c36804d0a5acc5788cf2ef9f39954cccb4 (patch)
treec48cf5ca805518176777f03ef4faf34a49fd9f08 /hicn-light
parentda59c2cb5c809d3e8b2cffc6668199d393793a9d (diff)
[HICN-347] memory leak in messageProcessor_Tick
Signed-off-by: michele papalini <micpapal@cisco.com> Change-Id: I9da21006b9c6b44790c5984e0d6e10cc4ade5b1b
Diffstat (limited to 'hicn-light')
-rw-r--r--hicn-light/src/hicn/processor/messageProcessor.c18
1 files changed, 10 insertions, 8 deletions
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 */