diff --git a/src/chat/server/main.c b/src/chat/server/main.c index 3d6fb48..ec0bfb4 100644 --- a/src/chat/server/main.c +++ b/src/chat/server/main.c @@ -61,15 +61,6 @@ int main(void) return 0; } -void die(char *exit_msg) -{ - fprintf(stderr, "%s\n", exit_msg); //ERR MSG - - why2_clean_memory(why2_get_default_memory_identifier()); //GARBAGE COLLECTOR - - exit(1); -} - char *read_socket(int socket) { FILE *opened = why2_fdopen(socket, "r"); //OPEN socket diff --git a/src/core/lib/utils/misc.c b/src/core/lib/utils/misc.c index 92a4322..fa39c24 100644 --- a/src/core/lib/utils/misc.c +++ b/src/core/lib/utils/misc.c @@ -465,4 +465,13 @@ char *why2_generate_key(int key_length) key[key_length] = '\0'; return key; +} + +void die(char *exit_msg) +{ + fprintf(stderr, "%s\n", exit_msg); //ERR MSG + + why2_clean_memory(why2_get_default_memory_identifier()); //GARBAGE COLLECTOR + + exit(1); } \ No newline at end of file