Fix #79199: curl_copy_handle() memory leak#5258
Closed
cmb69 wants to merge 1 commit intophp:PHP-7.3from
Closed
Conversation
We must not increase the refcount of the resource; we only have to make sure that the actual CURL handle is not freed prematurely, but this is already catered to in `_php_setup_easy_copy_handlers()`.
Member
|
To clarify, you're saying that this is handled by the |
Member
Author
To be precise, it's handled by Line 2145 in 53797c2 |
Member
|
@cmb69 Are you sure you linked to the right line there? |
Member
Author
|
Indeed, badly explained (in the commit message as well) – sorry! The point is that that curl_copy_handle() registers a new resource, so increasing the refcount of the original resource prevents it from ever get freed (before the end of the request). Currently, the only way to destroy the underlying |
nikic
approved these changes
Mar 12, 2020
Member
Author
|
Thanks! Applied as 2b5fc8e. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We must not increase the refcount of the resource; we only have to make
sure that the actual CURL handle is not freed prematurely, but this is
already catered to in
_php_setup_easy_copy_handlers().