1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-07 15:18:15 +00:00

Fix: close server_fd on brain_server()

This commit is contained in:
lhywk 2025-06-25 04:47:03 +00:00
parent 189e8acdf9
commit 45a3820560

View File

@ -3052,6 +3052,8 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
{
brain_logging (stderr, 0, "setsockopt: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password);
return -1;
@ -3061,6 +3063,8 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
{
brain_logging (stderr, 0, "setsockopt: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password);
return -1;
@ -3104,6 +3108,8 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
{
brain_logging (stderr, 0, "%s: %s\n", listen_host, gai_strerror (rc_getaddrinfo));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password);
return -1;
@ -3114,6 +3120,8 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
{
brain_logging (stderr, 0, "bind: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password);
return -1;
@ -3123,6 +3131,8 @@ int brain_server (const char *listen_host, const int listen_port, const char *br
{
brain_logging (stderr, 0, "listen: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password);
return -1;