From: Antony Dovgal Date: Wed, 20 Dec 2006 23:30:30 +0000 (+0000) Subject: MFH X-Git-Tag: php-5.2.1RC2~129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a0e2ccf490090f375903bc03c0d60c5aeee9434c;p=php MFH --- diff --git a/ext/standard/string.c b/ext/standard/string.c index 4814de6cf0..1be460d73e 100644 --- a/ext/standard/string.c +++ b/ext/standard/string.c @@ -1235,11 +1235,11 @@ quit_loop: } len = cend - comp; - ret = emalloc(len + 1); - memcpy(ret, comp, len); - ret[len] = '\0'; if (p_ret) { + ret = emalloc(len + 1); + memcpy(ret, comp, len); + ret[len] = '\0'; *p_ret = ret; } if (p_len) {