-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed memory leak introduced by 7cb5bdf
- Loading branch information
Showing
1 changed file
with
7 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -391,7 +391,7 @@ static zend_always_inline int process_nested_data(UNSERIALIZE_PARAMETER, HashTab | |
ZVAL_UNDEF(&key); | ||
|
||
if (!php_var_unserialize_internal(&key, p, max, NULL)) { | ||
zval_dtor(&key); | ||
zval_ptr_dtor(&key); | ||
return 0; | ||
} | ||
|
||
|
@@ -421,7 +421,7 @@ numeric_key: | |
data = zend_hash_add_new(ht, Z_STR(key), &d); | ||
} | ||
} else { | ||
zval_dtor(&key); | ||
zval_ptr_dtor(&key); | ||
return 0; | ||
} | ||
} else { | ||
|
@@ -435,7 +435,7 @@ string_key: | |
size_t unmangled_prop_len; | ||
|
||
if (UNEXPECTED(zend_unmangle_property_name_ex(Z_STR(key), &unmangled_class, &unmangled_prop, &unmangled_prop_len) == FAILURE)) { | ||
zval_dtor(&key); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
dstogov
Author
Member
|
||
zval_ptr_dtor(&key); | ||
return 0; | ||
} | ||
|
||
|
@@ -465,7 +465,7 @@ string_key: | |
new_key = unmangled; | ||
} | ||
zend_string_release(Z_STR(key)); | ||
Z_STR(key) = new_key; | ||
ZVAL_STR(&key, new_key); | ||
} else { | ||
zend_string_release(unmangled); | ||
} | ||
|
@@ -485,13 +485,13 @@ string_key: | |
convert_to_string(&key); | ||
goto string_key; | ||
} else { | ||
zval_dtor(&key); | ||
zval_ptr_dtor(&key); | ||
return 0; | ||
} | ||
} | ||
|
||
if (!php_var_unserialize_internal(data, p, max, var_hash)) { | ||
zval_dtor(&key); | ||
zval_ptr_dtor(&key); | ||
return 0; | ||
} | ||
|
||
|
@@ -505,7 +505,7 @@ string_key: | |
var_push_dtor(var_hash, data); | ||
} | ||
|
||
zval_dtor(&key); | ||
zval_ptr_dtor(&key); | ||
|
||
if (elements && *(*p-1) != ';' && *(*p-1) != '}') { | ||
(*p)--; | ||
|
1 comment
on commit 7be2637
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Sorry it slipped through.
Can this leak, given that
key
will only be a string here?