mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-26 12:12:10 +01:00
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:
parent
8945227743
commit
68f6d39895
@ -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)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user