Skip to content

Commit 0da08fe

Browse files
committed
Revert "fix invalid read, follow up on 97b65cc"
This reverts commit b52fa58.
1 parent b52fa58 commit 0da08fe

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

Zend/zend_ini_parser.y

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,16 +109,16 @@ static void zend_ini_init_string(zval *result)
109109
static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
110110
{
111111
int length, op1_len;
112-
zend_string *str = NULL;
113112

114113
if (Z_TYPE_P(op1) != IS_STRING) {
115-
str = zval_get_string(op1);
114+
zend_string *str = zval_get_string(op1);
116115
/* ZEND_ASSERT(!Z_REFCOUNTED_P(op1)); */
117116
if (ZEND_SYSTEM_INI) {
118117
ZVAL_PSTRINGL(op1, ZSTR_VAL(str), ZSTR_LEN(str));
119118
} else {
120119
ZVAL_STR(op1, str);
121120
}
121+
zend_string_release(str);
122122
}
123123
op1_len = (int)Z_STRLEN_P(op1);
124124

@@ -129,10 +129,6 @@ static void zend_ini_add_string(zval *result, zval *op1, zval *op2)
129129

130130
ZVAL_NEW_STR(result, zend_string_extend(Z_STR_P(op1), length, ZEND_SYSTEM_INI));
131131
memcpy(Z_STRVAL_P(result) + op1_len, Z_STRVAL_P(op2), Z_STRLEN_P(op2) + 1);
132-
133-
if (str) {
134-
zend_string_release(str);
135-
}
136132
}
137133
/* }}} */
138134

0 commit comments

Comments
 (0)