cvs: php-src /ext/date php_date.c /ext/date/lib parse_tz.c
| From: | Antony Dovgal | Date: | Sat, 18 Mar 2006 23:44:30 +0000 |
| Subject: | cvs: php-src /ext/date php_date.c /ext/date/lib parse_tz.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-37340@lists.php.net to get a copy of this message | ||
tony2001 Sat Mar 18 23:44:30 2006 UTC
Modified files:
/php-src/ext/date php_date.c
/php-src/ext/date/lib parse_tz.c
Log:
MFB: fix several leaks in date_sun*() functions
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/php_date.c?r1=1.87&r2=1.88&diff_format=u
Index: php-src/ext/date/php_date.c
diff -u php-src/ext/date/php_date.c:1.87 php-src/ext/date/php_date.c:1.88
--- php-src/ext/date/php_date.c:1.87 Mon Mar 6 21:43:34 2006
+++ php-src/ext/date/php_date.c Sat Mar 18 23:44:30 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: php_date.c,v 1.87 2006/03/06 21:43:34 derick Exp $ */
+/* $Id: php_date.c,v 1.88 2006/03/18 23:44:30 tony2001 Exp $ */
#include "php.h"
#include "php_streams.h"
@@ -1901,7 +1901,8 @@
timelib_unixtime2local(t, time);
rs = timelib_astro_rise_set_altitude(t, longitude, latitude, altitude, altitude > -1 ? 1 : 0,
&h_rise, &h_set, &rise, &set, &transit);
-
+ timelib_time_dtor(t);
+
if (rs != 0) {
RETURN_FALSE;
}
@@ -2044,6 +2045,8 @@
t2->sse = set;
add_assoc_long(return_value, "astronomical_twilight_end", timelib_date_to_int(t2,
&dummy));
}
+ timelib_time_dtor(t);
+ timelib_time_dtor(t2);
}
/* }}} */
/*
http://cvs.php.net/viewcvs.cgi/php-src/ext/date/lib/parse_tz.c?r1=1.25&r2=1.26&diff_format=u
Index: php-src/ext/date/lib/parse_tz.c
diff -u php-src/ext/date/lib/parse_tz.c:1.25 php-src/ext/date/lib/parse_tz.c:1.26
--- php-src/ext/date/lib/parse_tz.c:1.25 Wed Jan 4 12:57:04 2006
+++ php-src/ext/date/lib/parse_tz.c Sat Mar 18 23:44:30 2006
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: parse_tz.c,v 1.25 2006/01/04 12:57:04 derick Exp $ */
+/* $Id: parse_tz.c,v 1.26 2006/03/18 23:44:30 tony2001 Exp $ */
#include "timelib.h"
@@ -368,6 +368,7 @@
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 @@
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;