From 5fca7ef4838c6a8aede8a5e338940804e8e363f7 Mon Sep 17 00:00:00 2001 From: Jordan Augé Date: Mon, 28 Oct 2019 15:44:42 +0100 Subject: [HICN-363] Fix memory leaks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I7617becdb520f20caca341be11fbb8c1054de021 Signed-off-by: Jordan Augé --- hicn-light/src/hicn/config/configuration.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'hicn-light/src/hicn/config/configuration.c') diff --git a/hicn-light/src/hicn/config/configuration.c b/hicn-light/src/hicn/config/configuration.c index 4771c4073..c10b01c30 100644 --- a/hicn-light/src/hicn/config/configuration.c +++ b/hicn-light/src/hicn/config/configuration.c @@ -44,7 +44,7 @@ #include #include #ifdef WITH_MAPME -#include +#include #endif /* WITH_MAPME */ #include @@ -498,8 +498,8 @@ struct iovec *configuration_ProcessRemoveListener(Configuration *config, ConnectionTable *connTable = forwarder_GetConnectionTable(config->forwarder); ListenerOps *listenerOps = listenerSet_FindById(listenerSet, listenerId); if (listenerOps) { - ConnectionList *connectionList =connectionTable_GetEntries(connTable); - for (size_t i =0; i < connectionList_Length(connectionList); i++) { + ConnectionList *connectionList = connectionTable_GetEntries(connTable); + for (size_t i = 0; i < connectionList_Length(connectionList); i++) { Connection *connection = connectionList_Get(connectionList, i); const AddressPair *addressPair = connection_GetAddressPair(connection); const Address *address = addressPair_GetLocal(addressPair); @@ -514,6 +514,7 @@ struct iovec *configuration_ProcessRemoveListener(Configuration *config, symbolicNameTable_Remove(config->symbolicNameTable, symbolicConnection); } } + connectionList_Destroy(&connectionList); // remove listener listenerSet_RemoveById(listenerSet, listenerId); success = true; @@ -1391,6 +1392,7 @@ void configuration_ReceiveCommand(Configuration *config, command_id command, switch (command) { case LIST_CONNECTIONS: case LIST_ROUTES: // case LIST_INTERFACES: case ETC...: + case LIST_LISTENERS: parcMemory_Deallocate( &response[1] .iov_base); // deallocate payload only if generated at fwd side -- cgit 1.2.3-korg