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 diff --git a/lib/utils_base.c b/lib/utils_base.c index 176fa85..0f52126 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 v0.10-9-g596f