Fix allocator mismatch ech knownhosts#21150
Closed
MarkLee131 wants to merge 4 commits intocurl:masterfrom
Closed
Conversation
memory allocated by libcurl (curl_maprintf) must be freed with curl_free(), and memory allocated by the tool (curlx_strdup via findfile) must be freed with curlx_free(). - tool_cfgable: ech_config is allocated with curl_maprintf, free it with curl_free() instead of tool_safefree() - config2setopts: known hosts from findfile() is allocated with curlx_strdup, free it with curlx_free() instead of curl_free() - tool_findfile: fix comment to say curlx_free() instead of curl_free() Follow-up to b71973c
bagder
reviewed
Mar 29, 2026
bagder
reviewed
Mar 29, 2026
bagder
reviewed
Mar 29, 2026
Member
bagder
left a comment
There was a problem hiding this comment.
Thanks! It needs some minor adjustments though
For knownhosts, curlx_strdup() the findfile() result so that config->knownhosts always uses tool-memory. For ech_config, curlx_strdup() the curl_maprintf() result so that config->ech_config always uses tool-memory, matching the getstr() path.
Contributor
Author
|
Thanks for the review. |
bagder
approved these changes
Mar 30, 2026
Member
|
Thanks! |
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.
Fix #21149