1
0
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:
Thies C. Arntzen
1999-10-20 14:34:16 +00:00
parent af8f84a27c
commit 41b87a238e

View File

@@ -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;
}