File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -2048,13 +2048,16 @@ has_op2_string:;
2048
2048
}
2049
2049
2050
2050
if (result == op1 ) {
2051
+ /* special case, perform operations on result */
2052
+ result_str = zend_string_extend (op1_string , result_len , 0 );
2053
+ /* Free result after zend_string_extend(), as it may throw an out-of-memory error. If we
2054
+ * free it before we would leave the released variable on the stack with shutdown trying
2055
+ * to freeing it again. */
2051
2056
if (free_op1_string ) {
2052
2057
/* op1_string will be used as the result, so we should not free it */
2053
2058
i_zval_ptr_dtor (result );
2054
2059
free_op1_string = false;
2055
2060
}
2056
- /* special case, perform operations on result */
2057
- result_str = zend_string_extend (op1_string , result_len , 0 );
2058
2061
/* account for the case where result_str == op1_string == op2_string and the realloc is done */
2059
2062
if (op1_string == op2_string ) {
2060
2063
if (free_op2_string ) {
You can’t perform that action at this time.
0 commit comments