Skip to content
Snippets Groups Projects
Commit c1aaeaff authored by Tristan Matthews's avatar Tristan Matthews
Browse files

* #6623: fixed more leaks

parent af6a0d01
No related branches found
No related tags found
No related merge requests found
......@@ -414,8 +414,6 @@ history_state_t get_history_state_from_id (gchar *indice)
gchar* get_call_duration (callable_obj_t *obj)
{
gchar *res;
int duration;
time_t start, end;
......@@ -426,21 +424,24 @@ gchar* get_call_duration (callable_obj_t *obj)
return g_markup_printf_escaped ("<small>Duration:</small> 0:00");
duration = (int) difftime (end, start);
gchar *result;
if (duration / 60 == 0) {
if (duration < 10)
res = g_markup_printf_escaped ("00:0%i", duration);
result = g_markup_printf_escaped ("00:0%i", duration);
else
res = g_markup_printf_escaped ("00:%i", duration);
result = g_markup_printf_escaped ("00:%i", duration);
} else {
if (duration%60 < 10)
res = g_markup_printf_escaped ("%i:0%i" , duration/60 , duration%60);
result = g_markup_printf_escaped ("%i:0%i" , duration/60 , duration%60);
else
res = g_markup_printf_escaped ("%i:%i" , duration/60 , duration%60);
result = g_markup_printf_escaped ("%i:%i" , duration/60 , duration%60);
}
return g_markup_printf_escaped ("<small>Duration:</small> %s", res);
gchar *old_result = result;
result = g_markup_printf_escaped ("<small>Duration:</small> %s", old_result);
g_free(old_result);
return result;
}
static const gchar* get_history_id_from_state (history_state_t state)
......
......@@ -1058,6 +1058,7 @@ void calltree_add_history_entry (callable_obj_t *c, GtkTreeIter *parent)
date = get_formatted_start_timestamp (c->_time_start);
duration = get_call_duration (c);
gchar * full_duration = g_strconcat (date , duration , NULL);
g_free (date);
g_free (duration);
gchar * full_description = g_strconcat (description , full_duration, NULL);
g_free (description);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment