diff options
author | Wez Furlong <wez@php.net> | 2003-05-26 19:01:45 +0000 |
---|---|---|
committer | Wez Furlong <wez@php.net> | 2003-05-26 19:01:45 +0000 |
commit | 53035874943ef49f45a72aba46d7d66b6a97d6c3 (patch) | |
tree | 9d257df4be9f15dee63da0464981603fc309a558 | |
parent | 33bed67b99c1e45681b17f407eba1f09aca485d1 (diff) | |
download | php-git-53035874943ef49f45a72aba46d7d66b6a97d6c3.tar.gz |
Plug a leak - noticed by Ilia.
-rw-r--r-- | ext/standard/file.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 4bbf1ce459..489c96074c 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -415,7 +415,7 @@ PHP_FUNCTION(file_get_contents) { char *filename; int filename_len; - char *contents; + char *contents = NULL; zend_bool use_include_path = 0; php_stream *stream; int len, newlen; @@ -441,12 +441,17 @@ PHP_FUNCTION(file_get_contents) } RETVAL_STRINGL(contents, len, 0); + contents = NULL; } else if (len == 0) { RETVAL_EMPTY_STRING(); } else { RETVAL_FALSE; } + if (contents) { + efree(contents); + } + php_stream_close(stream); } |