summaryrefslogtreecommitdiffstats
path: root/lib/utils_base.c
diff options
context:
space:
mode:
authorRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-07-23 22:07:33 +0200
committerRincewindsHat <12514511+RincewindsHat@users.noreply.github.com>2023-07-23 22:07:33 +0200
commitc5e90822d7db1db504e19007a7078d1fa09267f2 (patch)
treebc14198c8cce1354b9c8aec54605e3611110a752 /lib/utils_base.c
parent103217831e07f26cead065985d0d007292ffd7ea (diff)
downloadmonitoring-plugins-c5e90822d7db1db504e19007a7078d1fa09267f2.tar.gz
Use memory on stack instead of heap for temporary variables
Diffstat (limited to 'lib/utils_base.c')
-rw-r--r--lib/utils_base.c6
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 /*