From 3b1d7dbd297cba50cbd54be118e549f879b2fc6a Mon Sep 17 00:00:00 2001 From: Jacques Samain Date: Wed, 20 Jan 2021 09:32:11 +0100 Subject: [HICN-668] Fix leaks + double free Signed-off-by: Jacques Samain Change-Id: Ic52adacaeee737120f08e4fece93eff44fa29f87 --- hicn-light/src/hicn/io/udpListener.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'hicn-light/src/hicn/io/udpListener.c') 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); } -- cgit 1.2.3-korg