Bug #79199 [PATCH]: curl_copy_handle() memory leak

From: Date: Wed, 11 Mar 2020 22:27:07 +0000
Subject: Bug #79199 [PATCH]: curl_copy_handle() memory leak
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226039@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 Patch added by: cmb@php.net Reported by: admin at yurunsoft dot com Summary: curl_copy_handle() memory leak Status: Verified Type: Bug Package: cURL related Operating System: All PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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 Previous Comments: ------------------------------------------------------------------------ [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 (#226039) next »