Schannel: plug a memory-leak #6457
Closed
Conversation
gvanem
referenced
this pull request
Jan 14, 2021
Bug: 8ab78f7#commitcomment-45445950 Reported-by: Gisle Vanem Closes #6381
I think |
Hm not even that, because the macro assigns the variable to NULL in non-unicode... Can't we remove the macro completely? |
No: because in non-unicode builds it is used for (or rather should be used for) pointing to data that isn't allocated. |
Speaking of such macros; it's IMHO more evident it's a macro if it was defined and used as |
I agree |
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
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.
Building with
DEBUGBUILD
and 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?