1
0
mirror of https://github.com/hashcat/hashcat.git synced 2025-07-04 22:02:36 +00:00

Merge pull request #4267 from lhywk/fix/socket-leak-brain-server

Fix socket leak in brain_server()
This commit is contained in:
Jens Steube 2025-06-25 07:24:45 +02:00 committed by GitHub
commit 669bd619cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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)); brain_logging (stderr, 0, "setsockopt: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password); if (brain_password == NULL) hcfree (auth_password);
return -1; 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)); brain_logging (stderr, 0, "setsockopt: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password); if (brain_password == NULL) hcfree (auth_password);
return -1; 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)); brain_logging (stderr, 0, "%s: %s\n", listen_host, gai_strerror (rc_getaddrinfo));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password); if (brain_password == NULL) hcfree (auth_password);
return -1; 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)); brain_logging (stderr, 0, "bind: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password); if (brain_password == NULL) hcfree (auth_password);
return -1; 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)); brain_logging (stderr, 0, "listen: %s\n", strerror (errno));
close(server_fd);
if (brain_password == NULL) hcfree (auth_password); if (brain_password == NULL) hcfree (auth_password);
return -1; return -1;