Fw: cvs: php-src(PHP_5_2) /main/streams streams.c
| From: | Nuno Lopes | Date: | Wed, 21 Jun 2006 22:30:53 +0000 |
| Subject: | Fw: cvs: php-src(PHP_5_2) /main/streams streams.c | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-24175@lists.php.net to get a copy of this message | ||
Not sure why this didn't get through..
----- Original Message -----
Hi, @@ -1216,7 +1216,7 @@p = php_stream_mmap_range(src, php_stream_tell(src), maxlen, PHP_STREAM_MAP_MODE_SHARED_READONLY, &mapped);- if (p) { + if (p && mapped) { *buf = pemalloc_rel_orig(mapped + 1, persistent);if (*buf) {I don't think this "fix" is correct. With your patch, PHP will do more 2 syscalls without any reason (because PHP will try to read the file again). Anyway, I don't get any memory leak without your patch (at least with PHP 5.2). And take a look at _php_stream_passthru() or _php_stream_copy_to_stream(). If your patch is correct, these function would also need to be patched. Again, I get zero leaks. Nuno