summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2018-02-26 16:54:53 +0800
committerXinchen Hui <laruence@gmail.com>2018-02-26 16:54:53 +0800
commit13eca3d4286287ebb329ea9126e1b32617c8254e (patch)
treea6b6e7346855be6b00a276acbc37b07ff3df92ae
parentfd88e7e3a1638d3f5b8661b63de44aeee755325a (diff)
downloadphp-git-13eca3d4286287ebb329ea9126e1b32617c8254e.tar.gz
Avoding memory allocation
-rw-r--r--ext/standard/string.c2
1 files changed, 1 insertions, 1 deletions
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)));