mirror of
https://github.com/php/php-src.git
synced 2024-09-22 02:17:32 +00:00
Fixed memory leak with manual calls to DateInterval::__unserialize
This commit is contained in:
parent
f869a546e7
commit
76e852e7e8
@ -4104,6 +4104,12 @@ PHP_METHOD(DateInterval, __construct)
|
||||
|
||||
static void php_date_interval_initialize_from_hash(zval **return_value, php_interval_obj **intobj, HashTable *myht) /* {{{ */
|
||||
{
|
||||
/* If ->diff is already set, then we need to free it first */
|
||||
if ((*intobj)->diff) {
|
||||
timelib_rel_time_dtor((*intobj)->diff);
|
||||
}
|
||||
|
||||
/* Set new value */
|
||||
(*intobj)->diff = timelib_rel_time_ctor();
|
||||
|
||||
#define PHP_DATE_INTERVAL_READ_PROPERTY(element, member, itype, def) \
|
||||
|
Loading…
Reference in New Issue
Block a user