From c5e90822d7db1db504e19007a7078d1fa09267f2 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Sun, 23 Jul 2023 22:07:33 +0200 Subject: Use memory on stack instead of heap for temporary variables --- lib/utils_base.c | 6 +----- 1 file changed, 1 insertion(+), 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() { char keyname[41]; char *p=NULL; - unsigned char *result = malloc(256 * sizeof(unsigned char)); - - if (result == NULL) { - die(STATE_UNKNOWN, _("Failed to allocate memory for hashes: %s"), strerror(errno)); - } + unsigned char result[256]; #ifdef USE_OPENSSL /* -- cgit v1.2.3-74-g34f1