speechd-discuss
[Top][All Lists]
Advanced

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

[PATCH] Memory leak in module_utils.c


From: jose vilmar estacio de souza
Subject: [PATCH] Memory leak in module_utils.c
Date: Sat, 11 Sep 2010 11:27:21 -0300

The function do_list_voices creates a GString to format the list of voices.
After the creation, the function returns the character data of the string
but does not free the memory allocated for the GString.
---
  src/modules/module_utils.c |    2 +-
  1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/modules/module_utils.c b/src/modules/module_utils.c
index b6d938f..da68402 100644
--- a/src/modules/module_utils.c
+++ b/src/modules/module_utils.c
@@ -470,7 +470,7 @@ do_list_voices(void)

    DBG("Voice prepared to  sens to speechd");

-  return voice_list->str;
+  return g_string_free(voice_list, 0);
  }

  #undef SET_PARAM_NUM
-- 
1.7.0.4



reply via email to

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