[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>
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Christopher Brannon, 2010/09/13
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Andrei Kholodnyi, 2010/09/15
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Christopher Brannon, 2010/09/15
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Andrei Kholodnyi, 2010/09/16
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Trevor Saunders, 2010/09/16
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Andrei Kholodnyi, 2010/09/17
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Trevor Saunders, 2010/09/17
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Christopher Brannon, 2010/09/16
- [PATCH] Rework the do_list_voices function, and fix a memory leak.,
Andrei . Kholodnyi <=
- [PATCH] Rework the do_list_voices function, and fix a memory leak., William Hubbs, 2010/09/16
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Christopher Brannon, 2010/09/16
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Andrei Kholodnyi, 2010/09/16
- [PATCH] Rework the do_list_voices function, and fix a memory leak., Christopher Brannon, 2010/09/16