mirror of
https://github.com/hashcat/hashcat.git
synced 2025-07-04 05:42:35 +00:00
Merge pull request #4267 from lhywk/fix/socket-leak-brain-server
Fix socket leak in brain_server()
This commit is contained in:
commit
669bd619cd
10
src/brain.c
10
src/brain.c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user