summaryrefslogtreecommitdiffstats
path: root/web/attachments/321258-patch-521097.diff
blob: 80d538651d2f9db399ceee62993c89d089959f32 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
diff -u nagios-plugins-1.4.12/debian/changelog nagios-plugins-1.4.12/debian/changelog
--- nagios-plugins-1.4.12.orig/plugins/check_nt.c
+++ nagios-plugins-1.4.12/plugins/check_nt.c
@@ -134,6 +134,11 @@
 	/* set socket timeout */
 	alarm(socket_timeout);
 
+	if (NULL==server_address) {
+		fputs("missing -H parameter\n", stderr);
+		exit(return_code);
+	}
+
 	switch (vars_to_check) {
 
 	case CHECK_CLIENTVERSION:
@@ -517,7 +522,6 @@
 				print_revision(progname,revision);
 				exit(STATE_OK);
 			case 'H': /* hostname */
-				if (server_address)	free(server_address);
 				server_address = optarg;
 				break;
 			case 's': /* password */