Re: return_value leaks memory with list()
| From: | Wez Furlong | Date: | Fri, 03 Jun 2005 13:02:07 +0000 |
| Subject: | Re: return_value leaks memory with list() | ||
| References: | 1 | Groups: | php.pecl.dev |
| Request: | Send a blank email to pecl-dev+get-2414@lists.php.net to get a copy of this message | ||
Can you repeat this with the latest stable php 5? (or even with HEAD?)
On 6/3/05, Michael Wallner <mike@php.net> wrote:
> Hi,
>
> I have an odd issue with http_split_response()
>
> http_split_response naivly parses http response messages
> into an array looking like:
>
> array(
> 0 => array(
> 'Server' => 'Apache',
> 'Set-Cookie' => 'Foo=Bar'
> ),
> 1 => 'Body'
> )
>
> For some (to me unknown) reason the return_value won't
> get freed accurately if I list it into an object member array:
>
> class t {
> var $r = array();
> function parse($r) {
> list($this->r['hdrs'], $this->r['body']) =
> http_parse_response($r);
> }
> }
>
> $t = new t;
> $t->parse("HTTP/1.1 200 Ok\r\nContent-Type: text/plain\r\nContent-Language:
> de-AT\r\nDate: Sat, 22 Jan 2005 18:10:02 GMT\r\n\r\nHallo Du!");
>
> zend\zend_hash.c(242) : Freeing 0x00FC1C60 (40 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> Last leak repeated 3 times
> zend\zend_api.c(811) : Freeing 0x00FC1C18 (16 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> Last leak repeated 3 times
> ext\http\http_headers_api.c(304) : Freeing 0x00FC5718 (6 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> Last leak repeated 2 times
> ext\http\http_api.c(223) : Freeing 0x00FC5D58 (10 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> ext\http\http_functions.c(620) : Freeing 0x00FC5CF0 (44 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> zend\zend_api.c(648) : Actual location (location was relayed)
> Last leak repeated 1 time
> ext\http\http_functions.c(619) : Freeing 0x00FC5CA8 (16 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> ext\http\http_functions.c(617) : Freeing 0x00FC5408 (16 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
> ext\http\http_headers_api.c(355) : Freeing 0x00FC5270 (7 bytes),
> script=D:\Daten\Source\php-5.0.2\ext\http\tests\split_response_002.php
>
>
> php test:
> http://cvs.php.net/co.php/pecl/http/tests/split_response_002.phpt
> PHP_FUNCTION: 9îÕý\/&*%ä
> Ïhttp://cvs.php.net/co.php/pecl/http/http_functions.c#633
> C functions:
> http://cvs.php.net/co.php/pecl/http/http_api.c#214
>
> http://cvs.php.net/co.php/pecl/http/http_headers_api.c#250
>
>
> As usual - any hints greatly appreciated!
>
> Thanks,
> --
> Michael - < mike(@)php.net >
>
>
>