com php-src: Fixed the memroy leak first (refactor it later): ext/standard/file.c

From: Date: Sun, 23 Feb 2014 13:43:59 +0000
Subject: com php-src: Fixed the memroy leak first (refactor it later): ext/standard/file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-77993@lists.php.net to get a copy of this message
Commit: 70baf8f4192c2834326703cc969878b2daf630f4 Author: Xinchen Hui <laruence@gmail.com> Sun, 23 Feb 2014 21:43:59 +0800 Parents: 91e2a9139694d24c341cdc648dae8148912412de Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=70baf8f4192c2834326703cc969878b2daf630f4 Log: Fixed the memroy leak first (refactor it later) Changed paths: M ext/standard/file.c Diff: diff --git a/ext/standard/file.c b/ext/standard/file.c index 596bdef..5004b11 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 {

« previous php.cvs (#77993) next »