From 25d11590b80c9a7d17822f8a4d06cde3f79a8a01 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Sun, 13 Mar 2022 15:24:21 +0100 Subject: [PATCH] fixed possible memory leaking issue --- src/encrypter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encrypter.c b/src/encrypter.c index a51730a..f2cfd52 100644 --- a/src/encrypter.c +++ b/src/encrypter.c @@ -102,7 +102,7 @@ encryptText(char *text, char *keyNew) //LOAD returningText for (int i = 0; i < (sizeof(textKeyChain) / sizeof(int)); i++) { - textBuffer = malloc(10); + textBuffer = malloc(floor(log10(abs(textKeyChain[i])))); sprintf(textBuffer, "%d", textKeyChain[i]);