X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_by_ssh.c;h=0cffaeb2ef251c81e77bd4e5c6aa8efb6fc343f7;hb=782bc207d5697f539beb1fd3359ce81d22e26a54;hp=34e6727478c17d0f3e0e45edb3794cddb0998ffc;hpb=b6f64e12900d1dc308a3325b4c5d80e76eade984;p=nagiosplug.git 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) 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);