diff options
| author | Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> | 2025-11-16 15:43:41 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-11-16 15:43:41 +0100 |
| commit | 8c2fe21c3a3a392b084fd5a67bc5f250c2a9ec34 (patch) | |
| tree | 8bfe05f89b1ef63b94c9d33180a77c3a2c537d13 /plugins/runcmd.c | |
| parent | 2510d9ad5851c669ace7cfc16ea3ff9bf2c86106 (diff) | |
| parent | 584272e97d5c72ad6a7fb9b91844592252040ed9 (diff) | |
| download | monitoring-plugins-8c2fe21c3a3a392b084fd5a67bc5f250c2a9ec34.tar.gz | |
Merge pull request #2177 from RincewindsHat/modern_output/check_by_sshHEADmastercoverity/master
Modern output/check by ssh
Diffstat (limited to 'plugins/runcmd.c')
| -rw-r--r-- | plugins/runcmd.c | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/plugins/runcmd.c b/plugins/runcmd.c index 7c583b85..be6691d2 100644 --- a/plugins/runcmd.c +++ b/plugins/runcmd.c | |||
| @@ -300,7 +300,6 @@ static int np_fetch_output(int fd, output *op, int flags) { | |||
| 300 | } | 300 | } |
| 301 | 301 | ||
| 302 | op->line = NULL; | 302 | op->line = NULL; |
| 303 | op->lens = NULL; | ||
| 304 | i = 0; | 303 | i = 0; |
| 305 | while (i < op->buflen) { | 304 | while (i < op->buflen) { |
| 306 | /* make sure we have enough memory */ | 305 | /* make sure we have enough memory */ |
| @@ -311,7 +310,6 @@ static int np_fetch_output(int fd, output *op, int flags) { | |||
| 311 | } while (!ary_size); | 310 | } while (!ary_size); |
| 312 | 311 | ||
| 313 | op->line = realloc(op->line, ary_size * sizeof(char *)); | 312 | op->line = realloc(op->line, ary_size * sizeof(char *)); |
| 314 | op->lens = realloc(op->lens, ary_size * sizeof(size_t)); | ||
| 315 | } | 313 | } |
| 316 | 314 | ||
| 317 | /* set the pointer to the string */ | 315 | /* set the pointer to the string */ |
| @@ -323,9 +321,6 @@ static int np_fetch_output(int fd, output *op, int flags) { | |||
| 323 | } | 321 | } |
| 324 | buf[i] = '\0'; | 322 | buf[i] = '\0'; |
| 325 | 323 | ||
| 326 | /* calculate the string length using pointer difference */ | ||
| 327 | op->lens[lineno] = (size_t)&buf[i] - (size_t)op->line[lineno]; | ||
| 328 | |||
| 329 | lineno++; | 324 | lineno++; |
| 330 | i++; | 325 | i++; |
| 331 | } | 326 | } |
