8000 Fixed memory leak with unserialize was called multiple times and an a… · php/php-src@97db8b3 · GitHub
[go: up one dir, main page]

Skip to content

Commit 97db8b3

Browse files
committed
Fixed memory leak with unserialize was called multiple times and an abbreviation was stored
1 parent 81a19ea commit 97db8b3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

ext/date/php_date.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3110,6 +3110,12 @@ PHP_METHOD(DateTimeImmutable, sub)
31103110

31113111
static void set_timezone_from_timelib_time(php_timezone_obj *tzobj, timelib_time *t)
31123112
{
3113+
/* Free abbreviation if already set */
3114+
if (tzobj->initialized && tzobj->type == TIMELIB_ZONETYPE_ABBR) {
3115+
timelib_free(tzobj->tzi.z.abbr);
3116+
}
3117+
3118+
/* Set new values */
31133119
tzobj->initialized = 1;
31143120
tzobj->type = t->zone_type;
31153121

0 commit comments

Comments
 (0)
0