aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/check_by_ssh.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/check_by_ssh.c b/plugins/check_by_ssh.c
index 34e67274..0cffaeb2 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -249,12 +249,12 @@ process_arguments (int argc, char **argv)
passive = TRUE;
break;
case 's': /* description of service to check */
- service = realloc (service, ++services);
+ service = realloc (service, (++services) * sizeof(char *));
p1 = optarg;
while (p2 = index (p1, ':')) {
*p2 = '\0';
asprintf (&service[services-1], "%s", p1);
- service = realloc (service, ++services);
+ service = realloc (service, (++services) * sizeof(char *));
p1 = p2 + 1;
}
asprintf (&service[services-1], "%s", p1);