From a1852354b4942ea5bc47fddb82226bbd9d834c22 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Fri, 9 Dec 2022 16:16:47 +0100 Subject: [PATCH] fixed textBuffer memory leak --- src/core/lib/encrypter.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/core/lib/encrypter.c b/src/core/lib/encrypter.c index e3c9c4e..cb186fb 100644 --- a/src/core/lib/encrypter.c +++ b/src/core/lib/encrypter.c @@ -125,14 +125,7 @@ outputFlags encryptText(char *text, char *keyNew) { numberBuffer = sizeof(int) * countIntLength(textKeyChain[i]); - if (i != 0) - { - textBuffer = realloc(textBuffer, numberBuffer); - } - else - { - textBuffer = malloc(numberBuffer); - } + textBuffer = realloc(textBuffer, numberBuffer); sprintf(textBuffer, "%d", textKeyChain[i]);