mainreplay: fix leak in decrypt_aes_128() (#1737)

In decrypt_aes_128() at src/apps/replay/mainreplay.c, it calls
base64decode() to allocates memory in encryptedText, but forgets to free
encryptedText in the end of this function. Add free() after finished
using encryptedText.

Signed-off-by: Lidong Yan <502024330056@smail.nju.edu.cn>
This commit is contained in:
Lidong Yan 2025-09-06 01:36:55 +08:00 committed by GitHub
parent 04a8e52e09
commit 439914716d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1841,6 +1841,7 @@ void decrypt_aes_128(char *in, const unsigned char *mykey) {
CRYPTO_ctr128_encrypt(encryptedText, outdata, newTotalSize, &key, state.ivec, state.ecount, &state.num,
(block128_f)AES_encrypt);
free(encryptedText);
strcat(last, (char *)outdata);
printf("%s\n", last);
}