|  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: Assigned: bjori (profile)
Status: Closed Package: Streams related
PHP Version: 5.1.4 OS: FreeBSD
Private report: No CVE-ID: None
 [2006-06-20 19:24 UTC]
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 ===


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-06-20 19:25 UTC]
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
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 Apr 15 16:01:28 2024 UTC