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 1996c6d3..587a7245 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 **); |
@@ -239,8 +235,8 @@ main (int argc, char **argv) | |||
239 | result = np_net_ssl_init(sd); | 235 | result = np_net_ssl_init(sd); |
240 | if(result != STATE_OK) { | 236 | if(result != STATE_OK) { |
241 | printf (_("CRITICAL - Cannot create SSL context.\n")); | 237 | printf (_("CRITICAL - Cannot create SSL context.\n")); |
242 | np_net_ssl_cleanup(); | ||
243 | close(sd); | 238 | close(sd); |
239 | np_net_ssl_cleanup(); | ||
244 | return STATE_CRITICAL; | 240 | return STATE_CRITICAL; |
245 | } else { | 241 | } else { |
246 | ssl_established = 1; | 242 | ssl_established = 1; |
@@ -764,10 +760,12 @@ recvlines(char *buf, size_t bufsize) | |||
764 | int | 760 | int |
765 | my_close (void) | 761 | my_close (void) |
766 | { | 762 | { |
763 | int result; | ||
764 | result = close(sd); | ||
767 | #ifdef HAVE_SSL | 765 | #ifdef HAVE_SSL |
768 | np_net_ssl_cleanup(); | 766 | np_net_ssl_cleanup(); |
769 | #endif | 767 | #endif |
770 | return close(sd); | 768 | return result; |
771 | } | 769 | } |
772 | 770 | ||
773 | 771 | ||