Commit 412ec143 authored by Tristan Matthews's avatar Tristan Matthews

* #6623: fixed more leaks

parent c1aaeaff
......@@ -261,7 +261,6 @@ account_list_get_registered_accounts (void)
gchar* account_list_get_current_id (void)
{
account_t *current;
current = account_list_get_current ();
......@@ -274,8 +273,7 @@ gchar* account_list_get_current_id (void)
gchar * account_list_get_ordered_list (void)
{
gchar *order="";
gchar *order = strdup("");
guint i;
for (i=0; i < account_list_get_size(); i++) {
......@@ -283,7 +281,9 @@ gchar * account_list_get_ordered_list (void)
account = account_list_get_nth (i);
if (account != NULL) {
order = g_strconcat (order, account->accountID, "/", NULL);
gchar *new_order = g_strconcat (order, account->accountID, "/", NULL);
g_free (order);
order = new_order;
}
}
......@@ -301,9 +301,8 @@ guint account_list_get_position (account_t *account)
for (i=0; i<size; i++) {
tmp = account_list_get_nth (i);
if (g_strcasecmp (tmp->accountID, account->accountID) == 0) {
if (g_strcasecmp (tmp->accountID, account->accountID) == 0)
return i;
}
}
// Not found
......
......@@ -730,15 +730,14 @@ process_dialing (callable_obj_t *c, guint keyval, gchar *key)
if (keyval < 127 || (keyval > 65400 && keyval < 65466)) {
if (c->_state == CALL_STATE_TRANSFERT) {
c->_trsft_to = g_strconcat (c->_trsft_to, key, NULL);
gchar *new_trsft = g_strconcat (c->_trsft_to, key, NULL);
g_free (c->_trsft_to);
c->_trsft_to = new_trsft;
} else {
dbus_play_dtmf (key);
c->_peer_number = g_strconcat (c->_peer_number, key, NULL);
}
if (c->_state == CALL_STATE_DIALING) {
//g_free(c->_peer_name);
//c->_peer_name = g_strconcat("\"\" <", c->_peer_number, ">", NULL);
gchar *new_peer_number = g_strconcat (c->_peer_number, key, NULL);
g_free (c->_peer_number);
c->_peer_number = new_peer_number;
}
calltree_update_call (current_calls, c, NULL);
......@@ -816,16 +815,6 @@ sflphone_keypad (guint keyval, gchar * key)
default:
// To play the dtmf when calling mail box for instance
dbus_play_dtmf (key);
if (keyval < 255 || (keyval >65453 && keyval < 65466)) {
//gchar * temp = g_strconcat(call_get_number(c), key, NULL);
//gchar * before = c->from;
//c->from = g_strconcat("\"",call_get_name(c) ,"\" <", temp, ">", NULL);
//g_free(before);
//g_free(temp);
//update_callable_obj_tree(current_calls,c);
}
break;
}
......
......@@ -337,7 +337,9 @@ static void account_move (gboolean moveUp, gpointer data)
// Set the order in the configuration file
dbus_set_accounts_order (account_list_get_ordered_list ());
gchar *ordered_account_list = account_list_get_ordered_list ();
dbus_set_accounts_order (ordered_account_list);
g_free (ordered_account_list);
}
/**
......
......@@ -1431,6 +1431,7 @@ dbus_get_current_audio_codec_name (const callable_obj_t * c)
if (error) {
g_error_free (error);
g_free (codecName);
codecName = g_strdup("");
}
......
......@@ -908,15 +908,14 @@ edit_paste (void * foo UNUSED)
case CALL_STATE_DIALING:
// Add the text to the number
{
gchar * before;
before = selectedCall->_peer_number;
gchar *before = selectedCall->_peer_number;
DEBUG ("TO: %s\n", before);
selectedCall->_peer_number = g_strconcat (before, no, NULL);
g_free (before);
if (selectedCall->_state == CALL_STATE_DIALING) {
if (selectedCall->_state == CALL_STATE_DIALING)
selectedCall->_peer_info = g_strconcat ("\"\" <",
selectedCall->_peer_number, ">", NULL);
}
calltree_update_call (current_calls, selectedCall, NULL);
}
......@@ -928,10 +927,12 @@ edit_paste (void * foo UNUSED)
case CALL_STATE_HOLD: { // Create a new call to hold the new text
selectedCall = sflphone_new_call();
g_free (selectedCall->_peer_number);
selectedCall->_peer_number = g_strconcat (selectedCall->_peer_number,
no, NULL);
DEBUG ("TO: %s", selectedCall->_peer_number);
g_free (selectedCall->_peer_info);
selectedCall->_peer_info = g_strconcat ("\"\" <",
selectedCall->_peer_number, ">", NULL);
......@@ -950,22 +951,25 @@ edit_paste (void * foo UNUSED)
gchar * temp = g_strconcat (selectedCall->_peer_number, oneNo,
NULL);
g_free (selectedCall->_peer_info);
selectedCall->_peer_info = get_peer_info (temp,
selectedCall->_peer_name);
g_free(temp);
g_free (temp);
g_free (onNo);
calltree_update_call (current_calls, selectedCall, NULL);
}
}
break;
}
} else { // There is no current call, create one
selectedCall = sflphone_new_call();
gchar * before = selectedCall->_peer_number;
selectedCall->_peer_number = g_strconcat (selectedCall->_peer_number, no,
new_peer_number = g_strconcat (selectedCall->_peer_number, no,
NULL);
g_free (selectedCall->_peer_number);
selectedCall->_peer_number = new_peer_number;
g_free (before);
DEBUG ("UIManager: TO: %s", selectedCall->_peer_number);
......@@ -975,18 +979,17 @@ edit_paste (void * foo UNUSED)
calltree_update_call (current_calls, selectedCall, NULL);
}
g_free (no);
}
static void
clear_history (void)
{
if(conferencelist_get_size(history) != 0) {
conferencelist_clean_history();
}
if (conferencelist_get_size(history) != 0)
conferencelist_clean_history();
if (calllist_get_size (history) != 0) {
if (calllist_get_size (history) != 0)
calllist_clean_history();
}
}
/**
......@@ -1016,8 +1019,8 @@ call_mailbox_cb (void)
account_id = g_strdup (current->accountID);
mailbox_call = create_new_call (CALL, CALL_STATE_DIALING, "", account_id, _ ("Voicemail"), to);
g_free(to);
g_free(account_id);
g_free (to);
g_free (account_id);
DEBUG ("TO : %s" , mailbox_call->_peer_number);
calllist_add_call (current_calls, mailbox_call);
calltree_add_call (current_calls, mailbox_call, NULL);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment