mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-05-28 04:35:40 -04:00
Close the socket on all exits (not just the OK one)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1813 f882894a-f735-0410-b71e-b25c423dba1c
This commit is contained in:
parent
dca25be31a
commit
2562434648
1 changed files with 2 additions and 0 deletions
|
|
@ -233,6 +233,7 @@ ssh_connect (char *haddr, int hport, char *remote_version)
|
|||
recv (sd, output, BUFF_SZ, 0);
|
||||
if (strncmp (output, "SSH", 3)) {
|
||||
printf (_("Server answer: %s"), output);
|
||||
close(sd);
|
||||
exit (STATE_CRITICAL);
|
||||
}
|
||||
else {
|
||||
|
|
@ -252,6 +253,7 @@ ssh_connect (char *haddr, int hport, char *remote_version)
|
|||
printf
|
||||
(_("SSH WARNING - %s (protocol %s) version mismatch, expected '%s'\n"),
|
||||
ssh_server, ssh_proto, remote_version);
|
||||
close(sd);
|
||||
exit (STATE_WARNING);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue