diff options
| author | Xinchen Hui <laruence@gmail.com> | 2014-02-23 21:43:59 +0800 |
|---|---|---|
| committer | Xinchen Hui <laruence@gmail.com> | 2014-02-23 21:43:59 +0800 |
| commit | 70baf8f4192c2834326703cc969878b2daf630f4 (patch) | |
| tree | bfff20589f921cda3d8dd03aeb618ca0d695fc4a | |
| parent | 91e2a9139694d24c341cdc648dae8148912412de (diff) | |
| download | php-git-70baf8f4192c2834326703cc969878b2daf630f4.tar.gz | |
Fixed the memroy leak first (refactor it later)
| -rw-r--r-- | ext/standard/file.c | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |
