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 <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=795165
This commit is contained in:
Philip Withnall 2018-04-11 16:02:49 +01:00
parent 8945227743
commit 68f6d39895

View File

@ -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)
{