summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f152e45)
raw | patch | inline | side by side (parent: f152e45)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 21 Jan 2004 12:49:12 +0000 (12:49 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Wed, 21 Jan 2004 12:49:12 +0000 (12:49 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@796 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_tcp.c | patch | blob | history |
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index c105c6ae286e7863c06845f6efbf89be97dea793..7bd48d1aa058d7e50702d503d9e45e207d722c94 100644 (file)
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
SERVICE = strdup ("NNTP");
SEND = NULL;
EXPECT = NULL;
- server_expect = realloc (server_expect, ++server_expect_count);
+ server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count));
asprintf (&server_expect[server_expect_count - 1], "200");
- server_expect = realloc (server_expect, ++server_expect_count);
+ server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count));
asprintf (&server_expect[server_expect_count - 1], "201");
asprintf (&QUIT, "QUIT\r\n");
PROTOCOL = TCP_PROTOCOL;
/* use default expect if none listed in process_arguments() */
if (EXPECT && server_expect_count == 0) {
- server_expect = malloc (++server_expect_count);
+ server_expect = malloc (sizeof (char *) * (++server_expect_count));
server_expect[server_expect_count - 1] = EXPECT;
}
case 'e': /* expect string (may be repeated) */
EXPECT = NULL;
if (server_expect_count == 0)
- server_expect = malloc (++server_expect_count);
+ server_expect = malloc (sizeof (char *) * (++server_expect_count));
else
- server_expect = realloc (server_expect, ++server_expect_count);
+ server_expect = realloc (server_expect, sizeof (char *) * (++server_expect_count));
server_expect[server_expect_count - 1] = optarg;
break;
case 'm':