From 8e4c885ee1a8f057fbe550e2d5b85cc8079564df Mon Sep 17 00:00:00 2001 From: Matthias Eble Date: Fri, 1 May 2009 11:16:37 +0200 Subject: Fixed crash from check_nt when -H unspecified or given multiple times (sf.net #2731755, debian #521097) --- plugins/check_nt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'plugins/check_nt.c') diff --git a/plugins/check_nt.c b/plugins/check_nt.c index ec944e4c..d038efe7 100644 --- a/plugins/check_nt.c +++ b/plugins/check_nt.c @@ -522,7 +522,6 @@ int process_arguments(int argc, char **argv){ print_revision(progname, NP_VERSION); exit(STATE_OK); case 'H': /* hostname */ - if (server_address) free(server_address); server_address = optarg; break; case 's': /* password */ @@ -585,6 +584,8 @@ int process_arguments(int argc, char **argv){ } } + if (server_address == NULL) + usage4 (_("You must provide a server address or host name")); if (vars_to_check==CHECK_NONE) return ERROR; -- cgit v1.2.3