speechd-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH (speechd-up)] speak_string leaks memory.


From: Christopher Brannon
Subject: [PATCH (speechd-up)] speak_string leaks memory.
Date: Wed, 17 Feb 2010 07:16:05 -0600

I was the person who submitted the patch that introduced this bug.
You can see it in the list archives.
The problem was that I shadowed a variable in a nested scope.
The variable pointed to allocated memory, which was never freed.
---
 speechd-up.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/speechd-up.c b/speechd-up.c
index 4dee668..1cf7aa0 100644
--- a/speechd-up.c
+++ b/speechd-up.c
@@ -421,7 +421,7 @@ speak_string(char *text)
   if (utf8_text == NULL)
     ret =  -1;
   else {
-    char *escaped_utf8_text = ssml_escape_text(utf8_text);
+    escaped_utf8_text = ssml_escape_text(utf8_text);
 
     if(escaped_utf8_text == NULL) {
       LOG(1, "No memory available to hold current string.");
-- 
1.6.6.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]