moved encrypter's 'fileBuffer' deallocation at the end of encryptText

This commit is contained in:
Václav Šmejkal 2022-07-11 17:52:45 +02:00
parent 635f946671
commit d35ce48684
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -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;
}