fixed textBuffer memory leak

This commit is contained in:
Václav Šmejkal 2022-12-09 16:16:47 +01:00
parent 003a5a5a7e
commit a1852354b4
No known key found for this signature in database
GPG Key ID: FD749A97DF2D5E19

View File

@ -125,14 +125,7 @@ outputFlags encryptText(char *text, char *keyNew)
{ {
numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]); numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]);
if (i != 0)
{
textBuffer = realloc(textBuffer, numberBuffer); textBuffer = realloc(textBuffer, numberBuffer);
}
else
{
textBuffer = malloc(numberBuffer);
}
sprintf(textBuffer, "%d", textKeyChain[i]); sprintf(textBuffer, "%d", textKeyChain[i]);