diff options
author | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-05-29 20:01:26 (GMT) |
---|---|---|
committer | Matthias Eble <psychotrahe@users.sourceforge.net> | 2007-05-29 20:01:26 (GMT) |
commit | 716ff400f04bd053a1bba0affd773b03f284baad (patch) | |
tree | 243c74944117c2912537ccfbb837fdf66a550171 /plugins/check_tcp.c | |
parent | 1e2982f0723fe7e884d63212530ad9c9d491a2f5 (diff) | |
download | monitoring-plugins-716ff400f04bd053a1bba0affd773b03f284baad.tar.gz |
Fix segfault when -e is specified multiple times. Thanks to John Rouillard and Ralph Roessner (#1475899)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1723 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r-- | plugins/check_tcp.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index a977077..315c752 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -517,7 +517,6 @@ process_arguments (int argc, char **argv) | |||
517 | asprintf(&server_send, "%s", optarg); | 517 | asprintf(&server_send, "%s", optarg); |
518 | break; | 518 | break; |
519 | case 'e': /* expect string (may be repeated) */ | 519 | case 'e': /* expect string (may be repeated) */ |
520 | EXPECT = NULL; | ||
521 | flags &= ~FLAG_EXACT_MATCH; | 520 | flags &= ~FLAG_EXACT_MATCH; |
522 | if (server_expect_count == 0) | 521 | if (server_expect_count == 0) |
523 | server_expect = malloc (sizeof (char *) * (++server_expect_count)); | 522 | server_expect = malloc (sizeof (char *) * (++server_expect_count)); |
@@ -619,7 +618,7 @@ print_help (void) | |||
619 | printf (" %s\n", "-s, --send=STRING"); | 618 | printf (" %s\n", "-s, --send=STRING"); |
620 | printf (" %s\n", _("String to send to the server")); | 619 | printf (" %s\n", _("String to send to the server")); |
621 | printf (" %s\n", "-e, --expect=STRING"); | 620 | printf (" %s\n", "-e, --expect=STRING"); |
622 | printf (" %s\n", _("String to expect in server response")); | 621 | printf (" %s %s\n", _("String to expect in server response"), _("(may be repeated)")); |
623 | printf (" %s\n", "-q, --quit=STRING"); | 622 | printf (" %s\n", "-q, --quit=STRING"); |
624 | printf (" %s\n", _("String to send server to initiate a clean close of the connection")); | 623 | printf (" %s\n", _("String to send server to initiate a clean close of the connection")); |
625 | printf (" %s\n", "-r, --refuse=ok|warn|crit"); | 624 | printf (" %s\n", "-r, --refuse=ok|warn|crit"); |