Skip to content

Commit 2536259

Browse files
committed
Fix leak in the patch, and revert a couple of lines I didn't mean to commit
1 parent ee115c8 commit 2536259

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

Zend/zend_execute.c

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -328,6 +328,7 @@ static inline void zend_assign_to_variable(znode *result, znode *op1, znode *op2
328328
int i;
329329

330330
if (T->EA.data.str_offset.str->value.str.len==0) {
331+
STR_FREE(T->EA.data.str_offset.str->value.str.val);
331332
T->EA.data.str_offset.str->value.str.val = (char *) emalloc(T->EA.data.str_offset.offset+1+1);
332333
} else {
333334
T->EA.data.str_offset.str->value.str.val = (char *) erealloc(T->EA.data.str_offset.str->value.str.val, T->EA.data.str_offset.offset+1+1);
@@ -1085,12 +1086,9 @@ ZEND_API void execute(zend_op_array *op_array ELS_DC)
10851086
EG(binary_op) = boolean_xor_function;
10861087
/* Fall through */
10871088
binary_op_addr:
1088-
{
1089-
zval *zp1 = get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R);
1090-
zval *zp2 = get_zval_ptr(&opline->op2, Ts, &EG(free_op1), BP_VAR_R);
1091-
1092-
EG(binary_op)(&Ts[opline->result.u.var].tmp_var, zp1, zp2);
1093-
}
1089+
EG(binary_op)(&Ts[opline->result.u.var].tmp_var,
1090+
get_zval_ptr(&opline->op1, Ts, &EG(free_op1), BP_VAR_R),
1091+
get_zval_ptr(&opline->op2, Ts, &EG(free_op2), BP_VAR_R) );
10941092
FREE_OP(&opline->op1, EG(free_op1));
10951093
FREE_OP(&opline->op2, EG(free_op2));
10961094
NEXT_OPCODE();

0 commit comments

Comments
 (0)