]> granicus.if.org Git - php/commitdiff
Fixed reference-counting
authorDmitry Stogov <dmitry@zend.com>
Wed, 5 Jun 2019 22:40:40 +0000 (01:40 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 5 Jun 2019 22:40:40 +0000 (01:40 +0300)
Zend/zend_operators.h

index 458ca66e2e95464e203e439d2f9d7163fd29ad5b..45c8305c34eff18c6b2ab29c46fc3cb89727ed3d 100644 (file)
@@ -287,7 +287,7 @@ static zend_always_inline void zend_tmp_string_release(zend_string *tmp) {
 /* Like zval_get_string, but returns NULL if the conversion fails with an exception. */
 static zend_always_inline zend_string *zval_try_get_string(zval *op) {
        if (EXPECTED(Z_TYPE_P(op) == IS_STRING)) {
-               return Z_STR_P(op);
+               return zend_string_copy(Z_STR_P(op));
        } else {
                return zval_try_get_string_func(op);
        }