From: Xinchen Hui Date: Sun, 23 Feb 2014 13:43:59 +0000 (+0800) Subject: Fixed the memroy leak first (refactor it later) X-Git-Tag: POST_PHPNG_MERGE~412^2~572 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=70baf8f4192c2834326703cc969878b2daf630f4;p=php Fixed the memroy leak first (refactor it later) --- diff --git a/ext/standard/file.c b/ext/standard/file.c index 596bdefc12..5004b119c6 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -555,8 +555,9 @@ PHP_FUNCTION(file_get_contents) } if ((len = php_stream_copy_to_mem(stream, &contents, maxlen, 0)) > 0) { -//??? RETVAL_STRINGL(contents, len, 0); +//??? RETVAL_STRINGL(contents, len, 0); RETVAL_STRINGL(contents, len); + efree(contents); } else if (len == 0) { RETVAL_EMPTY_STRING(); } else {