aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacques Samain <jsamain@cisco.com>2021-01-20 09:32:11 +0100
committerJacques Samain <jsamain@cisco.com>2021-01-20 09:41:15 +0100
commit3b1d7dbd297cba50cbd54be118e549f879b2fc6a (patch)
tree137d866b34f83b494d69ef261adbc515e6030391
parentaa7b78dfca61e4af67e660d0904f9cbe3e98f5dc (diff)
[HICN-668] Fix leaks + double free
Signed-off-by: Jacques Samain <jsamain@cisco.com> Change-Id: Ic52adacaeee737120f08e4fece93eff44fa29f87
-rw-r--r--hicn-light/src/hicn/core/messageHandler.h2
-rw-r--r--hicn-light/src/hicn/io/streamConnection.c2
-rw-r--r--hicn-light/src/hicn/io/udpListener.c5
3 files changed, 6 insertions, 3 deletions
diff --git a/hicn-light/src/hicn/core/messageHandler.h b/hicn-light/src/hicn/core/messageHandler.h
index a8b2a3e54..f6b3e4e36 100644
--- a/hicn-light/src/hicn/core/messageHandler.h
+++ b/hicn-light/src/hicn/core/messageHandler.h
@@ -321,7 +321,7 @@ static inline bool messageHandler_handleHooks(Forwarder * forwarder,
/* ... */
/* END Process */
-
+ parcMemory_Deallocate((void **)&packet);
return true;
}
diff --git a/hicn-light/src/hicn/io/streamConnection.c b/hicn-light/src/hicn/io/streamConnection.c
index 00298d1b0..53ffa74c3 100644
--- a/hicn-light/src/hicn/io/streamConnection.c
+++ b/hicn-light/src/hicn/io/streamConnection.c
@@ -610,7 +610,7 @@ static void _conn_readcb(PARCEventQueue *event, PARCEventType type,
// If received correctly the whole message, send to dispatcher
if (message) {
forwarder_ReceiveCommand(stream->forwarder, command, rx, stream->id);
- parcMemory_Deallocate((void **)&rx);
+ //parcMemory_Deallocate((void **)&rx);
parcEventBuffer_Destroy(&message);
}
diff --git a/hicn-light/src/hicn/io/udpListener.c b/hicn-light/src/hicn/io/udpListener.c
index 16e8c8ddf..3b318c500 100644
--- a/hicn-light/src/hicn/io/udpListener.c
+++ b/hicn-light/src/hicn/io/udpListener.c
@@ -481,6 +481,7 @@ static void _handleWldrNotification(UdpListener *udp, unsigned connId,
const Connection *conn = connectionTable_FindById(
forwarder_GetConnectionTable(udp->forwarder), connId);
if (conn == NULL) {
+ parcMemory_Deallocate((void **)&msgBuffer);
return;
}
@@ -556,6 +557,7 @@ static void _readCommand(ListenerOps * listener, int fd,
if (*command != REQUEST_LIGHT){
printf("the message received is not a command, drop\n");
+ parcMemory_Deallocate((void **) &command);
return;
}
@@ -563,6 +565,7 @@ static void _readCommand(ListenerOps * listener, int fd,
if (id >= LAST_COMMAND_VALUE){
printf("the message received is not a valid command, drop\n");
+ parcMemory_Deallocate((void **) &command);
return;
}
@@ -588,7 +591,7 @@ static void _readCommand(ListenerOps * listener, int fd,
forwarder_ReceiveCommand(udp->forwarder, id, request, connid);
parcMemory_Deallocate((void **) &command);
- parcMemory_Deallocate((void **) &request);
+ //parcMemory_Deallocate((void **) &request);
}