[gnome-todo] gtd-panel-today: fix leak of GDateTime
- From: Victor Toso de Carvalho <victortoso src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-todo] gtd-panel-today: fix leak of GDateTime
- Date: Fri, 28 Oct 2016 19:37:52 +0000 (UTC)
commit 67a1ced9095e965b257959ee5062f235df820911
Author: Victor Toso <me victortoso com>
Date: Thu Oct 27 23:23:17 2016 +0200
gtd-panel-today: fix leak of GDateTime
1,920 bytes in 60 blocks are definitely lost in loss record 15,758 of 16,018
at 0x4C2DB9D: malloc (vg_replace_malloc.c:299)
by 0xA5229D5: g_malloc (gmem.c:94)
by 0xA53CB3D: g_slice_alloc (gslice.c:1025)
by 0xA53CB7D: g_slice_alloc0 (gslice.c:1051)
by 0xA4FEE8B: g_date_time_alloc (gdatetime.c:428)
by 0xA4FF688: g_date_time_new (gdatetime.c:957)
by 0xA4FF8DF: g_date_time_new_utc (gdatetime.c:1049)
by 0x42468C: gtd_task__convert_icaltime (gtd-task.c:190)
by 0x4259AF: gtd_task_get_due_date (gtd-task.c:952)
by 0x436922: gtd_panel_today_count_tasks (gtd-panel-today.c:105)
Signed-off-by: Victor Toso <victortoso redhat com>
https://bugzilla.gnome.org/show_bug.cgi?id=773606
plugins/today-panel/gtd-panel-today.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/plugins/today-panel/gtd-panel-today.c b/plugins/today-panel/gtd-panel-today.c
index 19ddb3e..d2bddf8 100644
--- a/plugins/today-panel/gtd-panel-today.c
+++ b/plugins/today-panel/gtd-panel-today.c
@@ -105,7 +105,10 @@ gtd_panel_today_count_tasks (GtdPanelToday *panel)
task_dt = gtd_task_get_due_date (t->data);
if (!is_today (task_dt))
- continue;
+ {
+ g_clear_pointer (&task_dt, g_date_time_unref);
+ continue;
+ }
panel->task_list = g_list_prepend (panel->task_list, t->data);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]