summaryrefslogtreecommitdiff
path: root/Zend/zend_operators.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2014-07-10 21:45:09 +0400
committerDmitry Stogov <dmitry@zend.com>2014-07-10 21:45:09 +0400
commit4e291fab81eb8c7517d673705ae8a46bf178724b (patch)
tree5e536021c2388dd14aaf6fed7a2d62661d3ba7d7 /Zend/zend_operators.c
parentd81b287ce1f30fdc3d37eb4d30ac116073ee1329 (diff)
downloadphp-git-4e291fab81eb8c7517d673705ae8a46bf178724b.tar.gz
Fixed usage after free()
Diffstat (limited to 'Zend/zend_operators.c')
-rw-r--r--Zend/zend_operators.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c
index 4e7b479bda..76c732732e 100644
--- a/Zend/zend_operators.c
+++ b/Zend/zend_operators.c
@@ -627,12 +627,13 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC) /* {{{ */
TSRMLS_FETCH();
convert_object_to_type(op, &dst, IS_STRING, convert_to_string);
- zval_dtor(op);
if (Z_TYPE(dst) == IS_STRING) {
+ zval_dtor(op);
ZVAL_COPY_VALUE(op, &dst);
} else {
zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name->val);
+ zval_dtor(op);
ZVAL_NEW_STR(op, STR_INIT("Object", sizeof("Object")-1, 0));
}
break;