diff options
author | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-07-23 22:07:33 +0200 |
---|---|---|
committer | RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> | 2023-07-23 22:07:33 +0200 |
commit | c5e90822d7db1db504e19007a7078d1fa09267f2 (patch) | |
tree | bc14198c8cce1354b9c8aec54605e3611110a752 /lib | |
parent | 103217831e07f26cead065985d0d007292ffd7ea (diff) | |
download | monitoring-plugins-c5e90822d7db1db504e19007a7078d1fa09267f2.tar.gz |
Use memory on stack instead of heap for temporary variables
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utils_base.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index 176fa850..0f521263 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
@@ -407,11 +407,7 @@ char *_np_state_generate_key() { | |||
407 | char keyname[41]; | 407 | char keyname[41]; |
408 | char *p=NULL; | 408 | char *p=NULL; |
409 | 409 | ||
410 | unsigned char *result = malloc(256 * sizeof(unsigned char)); | 410 | unsigned char result[256]; |
411 | |||
412 | if (result == NULL) { | ||
413 | die(STATE_UNKNOWN, _("Failed to allocate memory for hashes: %s"), strerror(errno)); | ||
414 | } | ||
415 | 411 | ||
416 | #ifdef USE_OPENSSL | 412 | #ifdef USE_OPENSSL |
417 | /* | 413 | /* |