: nply/fiche2

commit bd1751693b93975e1e0a8754572897743caf0a6b
parent 8ff08a04093e51dfdbde0b6a4f8f3e58dcbe43be
Author: solusipse <solus1ps3@gmail.com>
Date: Sat, 2 Sep 2017 19:12:10 +0200

Fixed wrong order of cleanup calls
1 file changed, 2 insertions(+), 1 deletion(-)
M
fiche.c
|
3
++-
diff --git 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;
     }