Skip to content
Snippets Groups Projects
Commit 8eb80226 authored by Rafaël Carré's avatar Rafaël Carré
Browse files

Don't mix stack and heap based allocations

freeing stack pointers is asking for big trouble
parent 3965cc1f
Branches
Tags
No related merge requests found
...@@ -1435,7 +1435,7 @@ gchar* ...@@ -1435,7 +1435,7 @@ gchar*
dbus_get_current_audio_codec_name (const callable_obj_t * c) dbus_get_current_audio_codec_name (const callable_obj_t * c)
{ {
gchar* codecName = ""; gchar* codecName;
GError* error = NULL; GError* error = NULL;
org_sflphone_SFLphone_CallManager_get_current_audio_codec_name (callManagerProxy, org_sflphone_SFLphone_CallManager_get_current_audio_codec_name (callManagerProxy,
...@@ -1443,6 +1443,7 @@ dbus_get_current_audio_codec_name (const callable_obj_t * c) ...@@ -1443,6 +1443,7 @@ dbus_get_current_audio_codec_name (const callable_obj_t * c)
if (error) { if (error) {
g_error_free (error); g_error_free (error);
codecName = g_strdup("");
} }
DEBUG ("%s: codecName : %s", __PRETTY_FUNCTION__, codecName); DEBUG ("%s: codecName : %s", __PRETTY_FUNCTION__, codecName);
...@@ -1652,7 +1653,7 @@ dbus_get_audio_device_index (const gchar *name) ...@@ -1652,7 +1653,7 @@ dbus_get_audio_device_index (const gchar *name)
gchar* gchar*
dbus_get_current_audio_output_plugin() dbus_get_current_audio_output_plugin()
{ {
gchar* plugin = ""; gchar* plugin;
GError* error = NULL; GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin ( org_sflphone_SFLphone_ConfigurationManager_get_current_audio_output_plugin (
configurationManagerProxy, &plugin, &error); configurationManagerProxy, &plugin, &error);
...@@ -1660,6 +1661,7 @@ dbus_get_current_audio_output_plugin() ...@@ -1660,6 +1661,7 @@ dbus_get_current_audio_output_plugin()
if (error) { if (error) {
ERROR ("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message); ERROR ("Failed to call get_current_audio_output_plugin() on ConfigurationManager: %s", error->message);
g_error_free (error); g_error_free (error);
plugin = g_strdup("");
} }
return plugin; return plugin;
...@@ -1672,13 +1674,14 @@ dbus_get_current_audio_output_plugin() ...@@ -1672,13 +1674,14 @@ dbus_get_current_audio_output_plugin()
gchar* gchar*
dbus_get_noise_suppress_state() dbus_get_noise_suppress_state()
{ {
gchar* state = ""; gchar* state;
GError* error = NULL; GError* error = NULL;
org_sflphone_SFLphone_ConfigurationManager_get_noise_suppress_state (configurationManagerProxy, &state, &error); org_sflphone_SFLphone_ConfigurationManager_get_noise_suppress_state (configurationManagerProxy, &state, &error);
if (error) { if (error) {
ERROR ("DBus: Failed to call get_noise_suppress_state() on ConfigurationManager: %s", error->message); ERROR ("DBus: Failed to call get_noise_suppress_state() on ConfigurationManager: %s", error->message);
g_error_free (error); g_error_free (error);
state = g_strdup("");
} }
return state; return state;
...@@ -1704,12 +1707,13 @@ gchar * ...@@ -1704,12 +1707,13 @@ gchar *
dbus_get_echo_cancel_state(void) dbus_get_echo_cancel_state(void)
{ {
GError *error = NULL; GError *error = NULL;
gchar *state = ""; gchar *state;
org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state(configurationManagerProxy, &state, &error); org_sflphone_SFLphone_ConfigurationManager_get_echo_cancel_state(configurationManagerProxy, &state, &error);
if(error) { if(error) {
ERROR("DBus: Failed to call get_echo_cancel_state() on ConfigurationManager: %s", error->message); ERROR("DBus: Failed to call get_echo_cancel_state() on ConfigurationManager: %s", error->message);
g_error_free(error); g_error_free(error);
state = g_strdup("");
} }
return state; return state;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment