summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
authorAndrea Faulds <ajf@ajf.me>2014-12-13 21:11:09 +0000
committerAndrea Faulds <ajf@ajf.me>2014-12-13 21:11:09 +0000
commit8c99b65c4d2bc91aff7efce6f88713ebcb5d55c5 (patch)
tree1426f5c87e2b81475672157fc55c25b316da22af /Zend/zend_operators.c
parent0ea0b591d79ae0ee18d33533a5c701330836ff6b (diff)
downloadphp-git-8c99b65c4d2bc91aff7efce6f88713ebcb5d55c5.tar.gz
Fixed memory leak introduced by 73458e8f
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index bdb4ea8861..b43c672526 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -1162,6 +1162,9 @@ ZEND_API int mod_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /* {{{ *
return SUCCESS;
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval % op2_lval);
return SUCCESS;
}
@@ -1324,6 +1327,9 @@ ZEND_API int bitwise_or_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
op2_lval = Z_LVAL_P(op2);
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval | op2_lval);
return SUCCESS;
}
@@ -1379,6 +1385,9 @@ ZEND_API int bitwise_and_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
op2_lval = Z_LVAL_P(op2);
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval & op2_lval);
return SUCCESS;
}
@@ -1434,6 +1443,9 @@ ZEND_API int bitwise_xor_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
op2_lval = Z_LVAL_P(op2);
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval ^ op2_lval);
return SUCCESS;
}
@@ -1486,6 +1498,9 @@ ZEND_API int shift_left_function(zval *result, zval *op1, zval *op2 TSRMLS_DC) /
}
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval << op2_lval);
return SUCCESS;
}
@@ -1538,6 +1553,9 @@ ZEND_API int shift_right_function(zval *result, zval *op1, zval *op2 TSRMLS_DC)
}
}
+ if (op1 == result) {
+ zval_dtor(result);
+ }
ZVAL_LONG(result, op1_lval >> op2_lval);
return SUCCESS;
}