From 66add23df599a0a3b6cbbd2d7ee564f6e8e6935f Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Wed, 22 Feb 2023 10:47:14 +0100 Subject: [PATCH] fixed deallocation order in why2_communicate_thread --- src/chat/misc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/chat/misc.c b/src/chat/misc.c index ed7b381..2eb40c0 100644 --- a/src/chat/misc.c +++ b/src/chat/misc.c @@ -155,9 +155,9 @@ void *why2_communicate_thread(void *arg) printf("User exited.\t%d\n", connection.connection); //DEALLOCATION - remove_node(get_node(connection.connection)); - close(*((int*) arg)); why2_deallocate(received); + remove_node(get_node(connection.connection)); + close(connection.connection); return NULL; }