mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-06-13 18:50:01 -04:00
Avoid unnecessary malloc and use stack instead
This commit is contained in:
parent
cb55797937
commit
b96a8424f0
1 changed files with 1 additions and 6 deletions
|
|
@ -1062,11 +1062,7 @@ GOT_FIRST_CERT:
|
|||
bcopy("...",&output_header_search[sizeof(output_header_search)-4],4);
|
||||
}
|
||||
|
||||
char *tmp = malloc(DEFAULT_BUFFER_SIZE);
|
||||
|
||||
if (tmp == NULL) {
|
||||
die(STATE_UNKNOWN, "Failed to allocate buffer for output: %s\n", strerror(errno));
|
||||
}
|
||||
char tmp[DEFAULT_BUFFER_SIZE];
|
||||
|
||||
snprintf (tmp,
|
||||
DEFAULT_BUFFER_SIZE,
|
||||
|
|
@ -1079,7 +1075,6 @@ GOT_FIRST_CERT:
|
|||
server_url);
|
||||
|
||||
strcpy(msg, tmp);
|
||||
free(tmp);
|
||||
|
||||
result = STATE_CRITICAL;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue