Bug #79199 [Opn->Ver]: curl_copy_handle() memory leak
| From: | cmb@php.net | Date: | Fri, 31 Jan 2020 15:53:09 +0000 |
| Subject: | Bug #79199 [Opn->Ver]: curl_copy_handle() memory leak | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-225277@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79199&edit=1
ID: 79199
Updated by: cmb@php.net
Reported by: admin at yurunsoft dot com
Summary: curl_copy_handle() memory leak
-Status: Open
+Status: Verified
Type: Bug
Package: cURL related
Operating System: All
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Indeed, we're leaking the original curl handle zval. I wonder why
we increase its refcount[1].
[1] <https://github.com/php/php-src/blob/php-7.3.14/ext/curl/interface.c#L2166>
Previous Comments:
------------------------------------------------------------------------
[2020-01-31 01:42:11] admin at yurunsoft dot com
Description:
------------
---
From manual page: https://php.net/function.curl-copy-handle
---
When I use PHP >= 7.0
curl_copy_handle() memory leak
But, when I use PHP <= 5.6 it's OK!
Test script:
---------------
<?php
for($i = 0; $i < 5; ++$i)
{
$c1 = curl_init();
$c2 = curl_copy_handle($c1);
curl_close($c2);
curl_close($c1);
var_dump(memory_get_usage());
}
var_dump(PHP_VERSION);
Expected result:
----------------
int(120784)
int(120824)
int(120824)
int(120824)
int(120824)
string(6) "5.6.27"
Actual result:
--------------
int(869760)
int(869816)
int(870160)
int(870184)
int(870208)
string(23) "7.2.19-0ubuntu0.18.04.1"
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79199&edit=1