Schannel: plug a memory-leak#6457
Closed
gvanem wants to merge 1 commit into
Closed
Conversation
gvanem
referenced
this pull request
Jan 14, 2021
Bug: 8ab78f7#commitcomment-45445950 Reported-by: Gisle Vanem Closes #6381
bagder
approved these changes
Jan 14, 2021
bagder
left a comment
Member
There was a problem hiding this comment.
I think curlx_unicodefree() should only really be used if the variable doesn't exist in non-unicode builds because calling free() on a NULL pointer is defined and safe.
Member
|
Hm not even that, because the macro assigns the variable to NULL in non-unicode... Can't we remove the macro completely? |
Member
|
No: because in non-unicode builds it is used for (or rather should be used for) pointing to data that isn't allocated. |
Contributor
Author
|
Speaking of such macros; it's IMHO more evident it's a macro if it was defined and used as |
Member
|
I agree |
MarcelRaad
approved these changes
Jan 14, 2021
bagder
added a commit
that referenced
this pull request
Jan 14, 2021
CURLX_UNICODEFREE() is the name now to make it more obvious to users that this is a macro and not a plain or pretend-to-be function call. Suggested-by: Gisle Vanem Ref: #6457
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.
Building with
DEBUGBUILDand issuing these commands:This tool reports:
I did not build with
-DUNICODE. Hence thatcurlx_unicodefree(cert_hostname_buff)was a no-op andresponsible for the leak. Surely it should be
free()'d regardless of-DUNICODE. No?