From: Xinchen Hui Date: Mon, 26 Feb 2018 08:54:53 +0000 (+0800) Subject: Avoding memory allocation X-Git-Tag: php-7.3.0alpha1~299 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13eca3d4286287ebb329ea9126e1b32617c8254e;p=php Avoding memory allocation --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 969b56e9e4..b6dfa62c46 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -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)));