aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--daemon/daemon_aux.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/daemon/daemon_aux.c b/daemon/daemon_aux.c
index 65fbc4b..00841de 100644
--- a/daemon/daemon_aux.c
+++ b/daemon/daemon_aux.c
@@ -110,6 +110,7 @@ int mutator_server(FILE* log_file)
/*Bind*/
if (bind(socket_desc, (struct sockaddr*)&server, sizeof(server)) < 0)
{
+ close(socket_desc);
perror("bind failed.error.\n");
return 1;
}
@@ -150,7 +151,11 @@ int mutator_server(FILE* log_file)
fprintf(log_file, "%s", NFOUND_CONFIG);
fprintf(log_file, "%s%d%s", "fopen returned: ", errno, "\n");
fprintf(log_file, "%s", SERVER_TERM);
- CLEAN_UP();
+
+ fclose(log_file);
+ close(client_sock);
+ close(socket_desc);
+
return errno;
}