diff options
Diffstat (limited to 'plugins/check_smtp.c')
-rw-r--r-- | plugins/check_smtp.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/plugins/check_smtp.c b/plugins/check_smtp.c index a1c5f7ef..6e0e22ed 100644 --- a/plugins/check_smtp.c +++ b/plugins/check_smtp.c | |||
@@ -59,10 +59,6 @@ enum { | |||
59 | #define SMTP_STARTTLS "STARTTLS\r\n" | 59 | #define SMTP_STARTTLS "STARTTLS\r\n" |
60 | #define SMTP_AUTH_LOGIN "AUTH LOGIN\r\n" | 60 | #define SMTP_AUTH_LOGIN "AUTH LOGIN\r\n" |
61 | 61 | ||
62 | #ifndef HOST_MAX_BYTES | ||
63 | #define HOST_MAX_BYTES 255 | ||
64 | #endif | ||
65 | |||
66 | #define EHLO_SUPPORTS_STARTTLS 1 | 62 | #define EHLO_SUPPORTS_STARTTLS 1 |
67 | 63 | ||
68 | int process_arguments (int, char **); | 64 | int process_arguments (int, char **); |
@@ -228,8 +224,8 @@ main (int argc, char **argv) | |||
228 | result = np_net_ssl_init(sd); | 224 | result = np_net_ssl_init(sd); |
229 | if(result != STATE_OK) { | 225 | if(result != STATE_OK) { |
230 | printf (_("CRITICAL - Cannot create SSL context.\n")); | 226 | printf (_("CRITICAL - Cannot create SSL context.\n")); |
231 | np_net_ssl_cleanup(); | ||
232 | close(sd); | 227 | close(sd); |
228 | np_net_ssl_cleanup(); | ||
233 | return STATE_CRITICAL; | 229 | return STATE_CRITICAL; |
234 | } else { | 230 | } else { |
235 | ssl_established = 1; | 231 | ssl_established = 1; |
@@ -771,10 +767,12 @@ recvlines(char *buf, size_t bufsize) | |||
771 | int | 767 | int |
772 | my_close (void) | 768 | my_close (void) |
773 | { | 769 | { |
770 | int result; | ||
771 | result = close(sd); | ||
774 | #ifdef HAVE_SSL | 772 | #ifdef HAVE_SSL |
775 | np_net_ssl_cleanup(); | 773 | np_net_ssl_cleanup(); |
776 | #endif | 774 | #endif |
777 | return close(sd); | 775 | return result; |
778 | } | 776 | } |
779 | 777 | ||
780 | 778 | ||