summaryrefslogtreecommitdiff
path: root/ext/date/lib/parse_tz.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/lib/parse_tz.c')
-rw-r--r--ext/date/lib/parse_tz.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ext/date/lib/parse_tz.c b/ext/date/lib/parse_tz.c
index 737181da5c..aa8aebd46b 100644
--- a/ext/date/lib/parse_tz.c
+++ b/ext/date/lib/parse_tz.c
@@ -368,6 +368,7 @@ timelib_time_offset *timelib_get_time_zone_info(timelib_sll ts, timelib_tzinfo *
timelib_sll timelib_get_current_offset(timelib_time *t)
{
timelib_time_offset *gmt_offset;
+ timelib_sll retval;
switch (t->zone_type) {
case TIMELIB_ZONETYPE_ABBR:
@@ -376,7 +377,9 @@ timelib_sll timelib_get_current_offset(timelib_time *t)
case TIMELIB_ZONETYPE_ID:
gmt_offset = timelib_get_time_zone_info(t->sse, t->tz_info);
- return gmt_offset->offset;
+ retval = gmt_offset->offset;
+ timelib_time_offset_dtor(gmt_offset);
+ return retval;
default:
return 0;