From f44f037538a581ab85ad3f6f93dc678ccb419851 Mon Sep 17 00:00:00 2001 From: Jim Heising Date: Tue, 9 Apr 2013 22:29:51 -0700 Subject: [PATCH] Fixed memory leak in strtotime MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit timelib_tzinfo *tzi was being created but destroyed. Shouldn't timelib_tzinfo_dtor(tzi) be called? --- ext/date/php_date.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 4ef314369c738..5cb112f309081 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1456,11 +1456,13 @@ PHP_FUNCTION(strtotime) now->zone_type = TIMELIB_ZONETYPE_ID; timelib_unixtime2local(now, (timelib_sll) time(NULL)); } else { + timelib_tzinfo_dtor(tzi); RETURN_FALSE; } if (!time_len) { timelib_time_dtor(now); + timelib_tzinfo_dtor(tzi); RETURN_FALSE; } @@ -1471,6 +1473,7 @@ PHP_FUNCTION(strtotime) timelib_update_ts(t, tzi); ts = timelib_date_to_int(t, &error2); + timelib_tzinfo_dtor(tzi); timelib_time_dtor(now); timelib_time_dtor(t);