diff options
-rw-r--r-- | plugins/check_tcp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index c6acca76..e4c2440c 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -187,9 +187,9 @@ main (int argc, char **argv) | |||
187 | asprintf (&SERVICE, "NNTP"); | 187 | asprintf (&SERVICE, "NNTP"); |
188 | SEND = NULL; | 188 | SEND = NULL; |
189 | EXPECT = NULL; | 189 | EXPECT = NULL; |
190 | server_expect = realloc (server_expect, ++server_expect_count); | 190 | server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); |
191 | asprintf (&server_expect[server_expect_count - 1], "200"); | 191 | asprintf (&server_expect[server_expect_count - 1], "200"); |
192 | server_expect = realloc (server_expect, ++server_expect_count); | 192 | server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); |
193 | asprintf (&server_expect[server_expect_count - 1], "201"); | 193 | asprintf (&server_expect[server_expect_count - 1], "201"); |
194 | asprintf (&QUIT, "QUIT\r\n"); | 194 | asprintf (&QUIT, "QUIT\r\n"); |
195 | PROTOCOL = TCP_PROTOCOL; | 195 | PROTOCOL = TCP_PROTOCOL; |
@@ -209,7 +209,7 @@ main (int argc, char **argv) | |||
209 | 209 | ||
210 | /* use default expect if none listed in process_arguments() */ | 210 | /* use default expect if none listed in process_arguments() */ |
211 | if (EXPECT && server_expect_count == 0) { | 211 | if (EXPECT && server_expect_count == 0) { |
212 | server_expect = malloc (++server_expect_count); | 212 | server_expect = malloc (sizeof (char *) * (++server_expect_count)); |
213 | server_expect[server_expect_count - 1] = EXPECT; | 213 | server_expect[server_expect_count - 1] = EXPECT; |
214 | } | 214 | } |
215 | 215 | ||
@@ -447,9 +447,9 @@ process_arguments (int argc, char **argv) | |||
447 | case 'e': /* expect string (may be repeated) */ | 447 | case 'e': /* expect string (may be repeated) */ |
448 | EXPECT = NULL; | 448 | EXPECT = NULL; |
449 | if (server_expect_count == 0) | 449 | if (server_expect_count == 0) |
450 | server_expect = malloc (++server_expect_count); | 450 | server_expect = malloc (sizeof (char *) * (++server_expect_count)); |
451 | else | 451 | else |
452 | server_expect = realloc (server_expect, ++server_expect_count); | 452 | server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count)); |
453 | server_expect[server_expect_count - 1] = optarg; | 453 | server_expect[server_expect_count - 1] = optarg; |
454 | break; | 454 | break; |
455 | case 'm': | 455 | case 'm': |