moved fileBuffer deallocation to beggining of encrypter
it for some reason threw segfault
This commit is contained in:
parent
cfb55cd493
commit
d63c97614f
@ -25,6 +25,7 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
fileBuffer = fopen("/dev/urandom", "r");
|
fileBuffer = fopen("/dev/urandom", "r");
|
||||||
fread(&numberBuffer, 4, 1, fileBuffer);
|
fread(&numberBuffer, 4, 1, fileBuffer);
|
||||||
srand(numberBuffer);
|
srand(numberBuffer);
|
||||||
|
fclose(fileBuffer);
|
||||||
|
|
||||||
if (keyNew != NULL)
|
if (keyNew != NULL)
|
||||||
{
|
{
|
||||||
@ -112,7 +113,6 @@ outputFlags encryptText(char *text, char *keyNew, inputFlags flags)
|
|||||||
};
|
};
|
||||||
|
|
||||||
//DEALLOCATION
|
//DEALLOCATION
|
||||||
fclose(fileBuffer);
|
|
||||||
free(textKeyChain);
|
free(textKeyChain);
|
||||||
free(textBuffer);
|
free(textBuffer);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user