[gnome-todo] panel-today: fix leak of GDateTime



commit 15cd8f551e955ddf9a0d4659861153486fff36b6
Author: Victor Toso <me victortoso com>
Date:   Thu Oct 27 23:03:08 2016 +0200

    panel-today: fix leak of GDateTime
    
    26,418 (192 direct, 26,226 indirect) bytes in 6 blocks are definitely lost in loss record 16,070 of 16,088
       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 0xA4FF06A: g_date_time_from_instant (gdatetime.c:524)
       by 0xA4FF406: g_date_time_new_from_timeval (gdatetime.c:647)
       by 0xA4FF46C: g_date_time_new_now (gdatetime.c:705)
       by 0xA4FF48B: g_date_time_new_now_local (gdatetime.c:728)
       by 0x4367CF: is_today (gtd-panel-today.c:64)
       by 0x436915: gtd_panel_today_count_tasks (gtd-panel-today.c:106)
       by 0xA07D61B: g_cclosure_marshal_VOID__OBJECT (gmarshal.c:2062)
    
    Signed-off-by: Victor Toso <victortoso redhat com>
    
    https://bugzilla.gnome.org/show_bug.cgi?id=773606

 plugins/today-panel/gtd-panel-today.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/plugins/today-panel/gtd-panel-today.c b/plugins/today-panel/gtd-panel-today.c
index 66f300c..19ddb3e 100644
--- a/plugins/today-panel/gtd-panel-today.c
+++ b/plugins/today-panel/gtd-panel-today.c
@@ -67,6 +67,7 @@ is_today (GDateTime *dt)
       g_date_time_get_month (dt) == g_date_time_get_month (today) &&
       g_date_time_get_day_of_month (dt) == g_date_time_get_day_of_month (today))
     {
+      g_date_time_unref (today);
       return TRUE;
     }
 


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