summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/standard/var.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/standard/var.c b/ext/standard/var.c
index abcf81f06a..1f087e10e3 100644
--- a/ext/standard/var.c
+++ b/ext/standard/var.c
@@ -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;
}