php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37864 file_get_contents leaks memory on empty file
Submitted: 2006-06-20 19:24 UTC Modified: 2006-06-20 19:25 UTC
From: bjori@php.net Assigned: bjori (profile)
Status: Closed Package: Streams related
PHP Version: 5.1.4 OS: FreeBSD
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bjori@php.net
New email:
PHP Version: OS:

 

 [2006-06-20 19:24 UTC] bjori@php.net
Description:
------------
file_get_contents() leaks on empty file

Reproduce code:
---------------
bjori@lindsay php-5.1.4$ touch emptyfile
bjori@lindsay php-5.1.4$ sapi/cli/php -r 'file_get_contents("emptyfile");'


Actual result:
--------------
[Tue Jun 20 21:22:13 2006]  Script:  '-'
/usr/home/bjori/php-5.1.4/main/streams/streams.c(1220) :  
Freeing 0x082B07E4 (1 bytes), script=-
/usr/home/bjori/php-5.1.4/ext/standard/file.c(543) : Actual 
location (location was relayed)
=== Total 1 memory leaks detected ===


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-20 19:25 UTC] bjori@php.net
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

fixed in HEAD & 5_2
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 09 20:01:28 2024 UTC