From 73d503471c77dde174bcbd4f50c632fa200cdf7a Mon Sep 17 00:00:00 2001 From: Ilia Alshanetsky Date: Wed, 15 Jun 2005 23:42:55 +0000 Subject: Fixed memory leak. --- ext/date/lib/tm2unixtime.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index a62dbb8a34..9a56e8b3f2 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -211,16 +211,21 @@ static timelib_sll do_adjust_timezone(timelib_time *tz, timelib_tzinfo *tzi) /* No timezone in struct, fallback to reference if possible */ if (tzi) { timelib_time_offset *before, *after; + timelib_sll tmp; tz->is_localtime = 1; before = timelib_get_time_zone_info(tz->sse, tzi); after = timelib_get_time_zone_info(tz->sse - before->offset, tzi); timelib_set_timezone(tz, tzi); if (before->is_dst != after->is_dst) { - return -tz->z + (before->offset - after->offset); + tmp = -tz->z + (before->offset - after->offset); } else { - return -tz->z; + tmp = -tz->z; } + timelib_time_offset_dtor(before); + timelib_time_offset_dtor(after); + + return tmp; } } return 0; -- cgit v1.2.1