Skip to content

Commit

Permalink
Release the memory allocated by p_text in espeak-ng.c.
Browse files Browse the repository at this point in the history
  • Loading branch information
rhdunn committed Mar 22, 2018
1 parent 062cb8d commit bb19c7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/espeak-ng.c
Expand Up @@ -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);
Expand All @@ -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();
Expand Down

0 comments on commit bb19c7a

Please sign in to comment.