]> granicus.if.org Git - php/commitdiff
Avoding memory allocation
authorXinchen Hui <laruence@gmail.com>
Mon, 26 Feb 2018 08:54:53 +0000 (16:54 +0800)
committerXinchen Hui <laruence@gmail.com>
Mon, 26 Feb 2018 08:54:53 +0000 (16:54 +0800)
ext/standard/string.c

index 969b56e9e489169e86a51c7d7b3153c0993be56e..b6dfa62c46ebefce410778dfb57b22075f735326 100644 (file)
@@ -3657,7 +3657,7 @@ PHP_FUNCTION(addcslashes)
        }
 
        if (ZSTR_LEN(what) == 0) {
-               RETURN_STRINGL(ZSTR_VAL(str), ZSTR_LEN(str));
+               RETURN_STR_COPY(str);
        }
 
        RETURN_STR(php_addcslashes(str, 0, ZSTR_VAL(what), ZSTR_LEN(what)));