mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Merge branch 'PHP-8.3' into PHP-8.4
* PHP-8.3: random: Fix memory leak when serialization fails (#20383)
This commit is contained in:
@@ -330,11 +330,11 @@ PHP_METHOD(Random_Engine_Mt19937, __serialize)
|
||||
|
||||
/* state */
|
||||
array_init(&t);
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &t);
|
||||
if (!engine->engine.algo->serialize(engine->engine.state, Z_ARRVAL(t))) {
|
||||
zend_throw_exception(NULL, "Engine serialize failed", 0);
|
||||
RETURN_THROWS();
|
||||
}
|
||||
zend_hash_next_index_insert(Z_ARRVAL_P(return_value), &t);
|
||||
}
|
||||
/* }}} */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user