diff options
| author | Ilia Alshanetsky <iliaa@php.net> | 2002-10-22 18:07:11 +0000 |
|---|---|---|
| committer | Ilia Alshanetsky <iliaa@php.net> | 2002-10-22 18:07:11 +0000 |
| commit | 30abd18322f3f01e74afe44e01d2993b40d68694 (patch) | |
| tree | 6b593961409c77b1c0755a342698bd4d29fc97ec | |
| parent | f1d158c41c8a43d6e15e4aa8fcd56e916d5ba5ea (diff) | |
| download | php-git-30abd18322f3f01e74afe44e01d2993b40d68694.tar.gz | |
Fixed a possible segmentation fault in file() function.
| -rw-r--r-- | ext/standard/file.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c index 0ef7215478..1e10984cca 100644 --- a/ext/standard/file.c +++ b/ext/standard/file.c @@ -461,7 +461,7 @@ PHP_FUNCTION(file) { char *filename; int filename_len; - char *slashed, *target_buf, *p, *s, *e; + char *slashed, *target_buf=NULL, *p, *s, *e; register int i = 0; int target_len, len; char eol_marker = '\n'; @@ -516,7 +516,9 @@ PHP_FUNCTION(file) } } - efree(target_buf); + if (target_buf) { + efree(target_buf); + } php_stream_close(stream); } /* }}} */ |
