Re: cvs: php-src(PHP_5_2) /main/streams streams.c

From: Date: Tue, 20 Jun 2006 18:28:43 +0000
Subject: Re: cvs: php-src(PHP_5_2) /main/streams streams.c
References: 1 2  Groups: php.cvs 
Request: Send a blank email to php-cvs+get-38824@lists.php.net to get a copy of this message
touch emptyfile; php -r 'file_get_contents("emptyfile");' /usr/src/clean/php6/main/streams/streams.c(1639) : Freeing 0x083DB4E4 (1 bytes), script=- /usr/src/clean/php6/ext/standard/file.c(560) : Actual location (location was relayed) === Total 1 memory leaks detected === I'll add phpt in couple of minutes.. -Hannes On 6/20/06, Antony Dovgal <antony@zend.com> wrote:
Got any reproduce/test case ? On 20.06.2006 22:09, Hannes Magnusson wrote:
bjori         Tue Jun 20 18:09:50 2006 UTC
  Modified files:              (Branch: PHP_5_2)
    /php-src/main/streams     streams.c
Log: MFH: plug memleak http://cvs.php.net/viewvc.cgi/php-src/main/streams/streams.c?r1=1.82.2.6.2.2&r2=1.82.2.6.2.3&diff_format=u Index: php-src/main/streams/streams.c diff -u php-src/main/streams/streams.c:1.82.2.6.2.2 php-src/main/streams/streams.c:1.82.2.6.2.3
--- php-src/main/streams/streams.c:1.82.2.6.2.2       Fri Jun 16 14:09:01 2006
+++ php-src/main/streams/streams.c    Tue Jun 20 18:09:50 2006
@@ -19,7 +19,7 @@
    +----------------------------------------------------------------------+
*/ -/* $Id: streams.c,v 1.82.2.6.2.2 2006/06/16 14:09:01 rasmus Exp $ */ +/* $Id: streams.c,v 1.82.2.6.2.3 2006/06/20 18:09:50 bjori Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -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) {
-- Wbr, Antony Dovgal


« previous php.cvs (#38824) next »