mirror of
https://github.com/php/php-src.git
synced 2026-04-03 14:12:38 +02:00
(PHP var_dump, serialize) fixed mem_leak.
This commit is contained in:
@@ -87,8 +87,11 @@ void php_var_dump(pval **struc, int level)
|
||||
PHPWRITE(buf, strlen(buf));
|
||||
}
|
||||
c++;
|
||||
if (zend_hash_get_current_data(myht, (void **) (&data)) != SUCCESS || !data || (data == struc))
|
||||
if (zend_hash_get_current_data(myht, (void **) (&data)) != SUCCESS || !data || (data == struc)) {
|
||||
if (i == HASH_KEY_IS_STRING)
|
||||
efree(key);
|
||||
continue;
|
||||
}
|
||||
switch (i) {
|
||||
case HASH_KEY_IS_LONG:{
|
||||
pval *d = emalloc(sizeof(pval));
|
||||
@@ -238,8 +241,9 @@ void php_var_serialize(pval *buf, pval **struc)
|
||||
if ((i = zend_hash_get_current_key(myht, &key, &index)) == HASH_KEY_NON_EXISTANT) {
|
||||
break;
|
||||
}
|
||||
if (zend_hash_get_current_data(myht, (void **) (&data)) !=
|
||||
SUCCESS || !data || ((*data) == (*struc))) {
|
||||
if (zend_hash_get_current_data(myht, (void **) (&data)) != SUCCESS || !data || ((*data) == (*struc))) {
|
||||
if (i == HASH_KEY_IS_STRING)
|
||||
efree(key);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user