aboutsummaryrefslogtreecommitdiffstats
path: root/hicn-light/src/hicn/config/configuration.c
diff options
context:
space:
mode:
authorJordan Augé <jordan.auge@cisco.com>2019-10-28 15:44:42 +0100
committerMauro Sardara <msardara@cisco.com>2019-10-30 14:46:57 +0000
commit5fca7ef4838c6a8aede8a5e338940804e8e363f7 (patch)
tree341257400aaa3dd428340418a2c1a808bdbbb01c /hicn-light/src/hicn/config/configuration.c
parent3d674d504306489c4d845260f058ce44aa083f33 (diff)
[HICN-363] Fix memory leaks
Change-Id: I7617becdb520f20caca341be11fbb8c1054de021 Signed-off-by: Jordan Augé <jordan.auge@cisco.com>
Diffstat (limited to 'hicn-light/src/hicn/config/configuration.c')
-rw-r--r--hicn-light/src/hicn/config/configuration.c8
1 files changed, 5 insertions, 3 deletions
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 <hicn/core/forwarder.h>
#include <hicn/core/system.h>
#ifdef WITH_MAPME
-#include <hicn/core/mapMe.h>
+#include <hicn/core/mapme.h>
#endif /* WITH_MAPME */
#include <hicn/io/streamConnection.h>
@@ -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