mirror of
https://github.com/vanhauser-thc/thc-hydra.git
synced 2025-08-20 13:23:57 -07:00
ensure unneeded sockets are closed
This commit is contained in:
parent
fbefc67652
commit
fdc211dce5
2 changed files with 2 additions and 1 deletions
|
@ -605,6 +605,7 @@ void hydra_child_exit(int code) {
|
|||
do {
|
||||
sleepn(10);
|
||||
} while (read(intern_socket, buf, 1) <= 0);
|
||||
close(intern_socket);
|
||||
// sleep(2); // be sure that mommy receives our message
|
||||
exit(0); // might be killed before reaching this
|
||||
}
|
||||
|
|
2
hydra.c
2
hydra.c
|
@ -1560,7 +1560,7 @@ void hydra_kill_head(int head_no, int killit, int fail) {
|
|||
printf("[DEBUG] head_no %d, kill %d, fail %d\n", head_no, killit, fail);
|
||||
if (head_no < 0)
|
||||
return;
|
||||
if (hydra_heads[head_no]->active > 0) {
|
||||
if (hydra_heads[head_no]->active > 0 || (hydra_heads[head_no]->sp[0] > 2 && hydra_heads[head_no]->sp[1] > 2)) {
|
||||
close(hydra_heads[head_no]->sp[0]);
|
||||
close(hydra_heads[head_no]->sp[1]);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue