Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:24175 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 67825 invoked by uid 1010); 21 Jun 2006 22:30:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 67810 invoked from network); 21 Jun 2006 22:30:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 21 Jun 2006 22:30:47 -0000 X-PHP-List-Original-Sender: nlopess@php.net X-Host-Fingerprint: 212.55.154.23 relay3.ptmail.sapo.pt Linux 2.4/2.6 Received: from ([212.55.154.23:38999] helo=sapo.pt) by pb1.pair.com (ecelerity 2.1.1.3 r(11751M)) with ESMTP id DD/AA-62414-598C9944 for ; Wed, 21 Jun 2006 18:30:47 -0400 Received: (qmail 1292 invoked from network); 21 Jun 2006 22:30:54 -0000 Received: from unknown (HELO sapo.pt) (10.134.35.207) by relay3 with SMTP; 21 Jun 2006 22:30:54 -0000 Received: (qmail 8134 invoked from network); 21 Jun 2006 22:30:54 -0000 X-AntiVirus: PTMail-AV 0.3-0.88.2 X-Virus-Status: Clean (0.00610 seconds) Received: from unknown (HELO pc07653) (nunoplopes@sapo.pt@[82.155.74.143]) (envelope-sender ) by mta12 (qmail-ldap-1.03) with SMTP for ; 21 Jun 2006 22:30:54 -0000 Message-ID: <003301c69582$5b815ed0$0100a8c0@pc07653> To: "PHPdev" Date: Wed, 21 Jun 2006 23:30:53 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="Windows-1252"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2869 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 Subject: Fw: cvs: php-src(PHP_5_2) /main/streams streams.c From: nlopess@php.net ("Nuno Lopes") 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