aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_nt.c
diff options
context:
space:
mode:
authorGravatar Matthias Eble <psychotrahe@gmx.de> 2009-05-01 11:16:37 +0200
committerGravatar Matthias Eble <psychotrahe@gmx.de> 2009-05-01 11:16:37 +0200
commit8e4c885ee1a8f057fbe550e2d5b85cc8079564df (patch)
tree2de4062cd40fb0eb506dc22091d58e263de47ff3 /plugins/check_nt.c
parentdd52d7e5e7acfd42243bc1ce173a0bf5d62fe347 (diff)
downloadmonitoring-plugins-8e4c885ee1a8f057fbe550e2d5b85cc8079564df.tar.gz
Fixed crash from check_nt when -H unspecified or given multiple times (sf.net #2731755, debian #521097)
Diffstat (limited to 'plugins/check_nt.c')
-rw-r--r--plugins/check_nt.c3
1 files changed, 2 insertions, 1 deletions
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;