summaryrefslogtreecommitdiffstats
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 34e6727..0cffaeb 100644
--- a/plugins/check_by_ssh.c
+++ b/plugins/check_by_ssh.c
@@ -249,12 +249,12 @@ process_arguments (int argc, char **argv)
249 passive = TRUE; 249 passive = TRUE;
250 break; 250 break;
251 case 's': /* description of service to check */ 251 case 's': /* description of service to check */
252 service = realloc (service, ++services); 252 service = realloc (service, (++services) * sizeof(char *));
253 p1 = optarg; 253 p1 = optarg;
254 while (p2 = index (p1, ':')) { 254 while (p2 = index (p1, ':')) {
255 *p2 = '\0'; 255 *p2 = '\0';
256 asprintf (&service[services-1], "%s", p1); 256 asprintf (&service[services-1], "%s", p1);
257 service = realloc (service, ++services); 257 service = realloc (service, (++services) * sizeof(char *));
258 p1 = p2 + 1; 258 p1 = p2 + 1;
259 } 259 }
260 asprintf (&service[services-1], "%s", p1); 260 asprintf (&service[services-1], "%s", p1);