From 68f6d39895ab9f6154e7e17516465e4a791edb49 Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Wed, 11 Apr 2018 16:02:49 +0100 Subject: [PATCH] gdatetime: Fix a leak in g_date_time_new_week() This was a small leak of a GDateTime instance from an internal helper function, which was using it to calculate week numbers, and then forgot to free it. Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=795165 --- glib/gdatetime.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/glib/gdatetime.c b/glib/gdatetime.c index 0ec01a31e..f3ad02d86 100644 --- a/glib/gdatetime.c +++ b/glib/gdatetime.c @@ -1216,6 +1216,8 @@ g_date_time_new_week (GTimeZone *tz, gint year, gint week, gint week_day, gint h dt = g_date_time_new (tz, year, 1, 4, 0, 0, 0); g_date_time_get_week_number (dt, NULL, &jan4_week_day, NULL); + g_date_time_unref (dt); + ordinal_day = (week * 7) + week_day - (jan4_week_day + 3); if (ordinal_day < 0) {