From d35ce486846b7c200e8e84b960e33cec3a98be4b Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Mon, 11 Jul 2022 17:52:45 +0200 Subject: [PATCH] moved encrypter's 'fileBuffer' deallocation at the end of encryptText --- src/lib/encrypter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/encrypter.c b/src/lib/encrypter.c index dfc8d19..a8a066d 100644 --- a/src/lib/encrypter.c +++ b/src/lib/encrypter.c @@ -43,7 +43,6 @@ outputFlags encryptText(char *text, char *keyNew) fileBuffer = fopen("/dev/urandom", "r"); fread(&numberBuffer, 4, 1, fileBuffer); srand(numberBuffer); - fclose(fileBuffer); if (numberBuffer < 0) numberBuffer *= -1; //MAKE numberBuffer POSITIVE if (keyNew != NULL) @@ -147,6 +146,7 @@ outputFlags encryptText(char *text, char *keyNew) //DEALLOCATION free(textKeyChain); free(textBuffer); + fclose(fileBuffer); return output; }