speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] Rework the do_list_voices function, and fix a memory leak.


From: Andrei . Kholodnyi
Subject: [PATCH] Rework the do_list_voices function, and fix a memory leak.
Date: Thu, 16 Sep 2010 20:26:17 +0000

If you agree with this modification I can push your patch then :)

diff --git a/src/modules/module_utils.cb/src/modules/module_utils.c
index 9fcb593..2bbcb53 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -470,6 +470,13 @@ do_list_voices(void)
dialect = voices[i]->dialect;
g_string_append_printf(voice_list, "200-%s %s %s\n", voices[i]->name, lang,  
dialect);
}
+
+ /* check whether we found at least one voice */
+ if (voice_list->len == 0){
+ g_string_free(voice_list, TRUE);
+ return strdup("304 CANT LIST VOICES");
+ }
+
g_string_append(voice_list, "200 OK VOICE LIST SENT");

DBG("Voice prepared to send to speechd");
--
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20100916/404d1360/attachment.htm>


reply via email to

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