From bb19c7a336ab4fec5f76070cf8c471106d9c05fc Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Thu, 22 Mar 2018 19:37:25 +0000 Subject: [PATCH] Release the memory allocated by p_text in espeak-ng.c. --- src/espeak-ng.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/espeak-ng.c b/src/espeak-ng.c index d5eeaf14a5..b3d7028dc0 100644 --- a/src/espeak-ng.c +++ b/src/espeak-ng.c @@ -716,6 +716,8 @@ int main(int argc, char **argv) espeak_Synth(p_text, ix+1, 0, POS_CHARACTER, 0, synth_flags, NULL, NULL); } } + + free(p_text); } else if (f_text != NULL) { if ((p_text = (char *)malloc(filesize+1)) == NULL) { espeak_ng_PrintStatusCodeMessage(ENOMEM, stderr, NULL); @@ -726,6 +728,8 @@ int main(int argc, char **argv) p_text[filesize] = 0; espeak_Synth(p_text, filesize+1, 0, POS_CHARACTER, 0, synth_flags, NULL, NULL); fclose(f_text); + + free(p_text); } result = espeak_ng_Synchronize();