From bd1751693b93975e1e0a8754572897743caf0a6b Mon Sep 17 00:00:00 2001 From: solusipse Date: Sat, 2 Sep 2017 19:12:10 +0200 Subject: [PATCH] Fixed wrong order of cleanup calls --- fiche.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/fiche.c b/fiche.c index f5c62c7..e87ab83 100644 --- a/fiche.c +++ b/fiche.c @@ -615,10 +615,11 @@ static void *handle_connection(void *args) { print_error("Couldn't save a file!"); print_separator(); + close(c->socket); + // Cleanup free(c); free(slug); - close(c->socket); pthread_exit(NULL); return NULL; }