Bug #79199 [Ver->Csd]: curl_copy_handle() memory leak

From: Date: Thu, 12 Mar 2020 10:29:41 +0000
Subject: Bug #79199 [Ver->Csd]: curl_copy_handle() memory leak
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226057@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: Verified +Status: Closed Type: Bug Package: cURL related Operating System: All PHP Version: Irrelevant Assigned To: cmb Block user comment: N Private report: N New Comment: Automatic comment on behalf of cmbecker69@gmx.de Revision: http://git.php.net/?p=php-src.git;a=commit;h=2b5fc8e325e3f385851ab7a7a77010bbccd2b16e Log: Fix #79199: curl_copy_handle() memory leak Previous Comments: ------------------------------------------------------------------------ [2020-03-11 22:27:07] cmb@php.net The following pull request has been associated: Patch Name: Fix #79199: curl_copy_handle() memory leak On GitHub: https://github.com/php/php-src/pull/5258 Patch: https://github.com/php/php-src/pull/5258.patch ------------------------------------------------------------------------ [2020-01-31 15:53:09] cmb@php.net 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> ------------------------------------------------------------------------ [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

« previous php.bugs (#226057) next »