moved encrypter's 'fileBuffer' deallocation at the end of encryptText
This commit is contained in:
parent
635f946671
commit
d35ce48684
@ -43,7 +43,6 @@ outputFlags encryptText(char *text, char *keyNew)
|
|||||||
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 (numberBuffer < 0) numberBuffer *= -1; //MAKE numberBuffer POSITIVE
|
if (numberBuffer < 0) numberBuffer *= -1; //MAKE numberBuffer POSITIVE
|
||||||
|
|
||||||
if (keyNew != NULL)
|
if (keyNew != NULL)
|
||||||
@ -147,6 +146,7 @@ outputFlags encryptText(char *text, char *keyNew)
|
|||||||
//DEALLOCATION
|
//DEALLOCATION
|
||||||
free(textKeyChain);
|
free(textKeyChain);
|
||||||
free(textBuffer);
|
free(textBuffer);
|
||||||
|
fclose(fileBuffer);
|
||||||
|
|
||||||
return output;
|
return output;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user