Skip to content

ldap: use correct memory free function - #6671

Closed
danielgustafsson wants to merge 1 commit into
curl:masterfrom
danielgustafsson:dg-ldap_free
Closed

ldap: use correct memory free function#6671
danielgustafsson wants to merge 1 commit into
curl:masterfrom
danielgustafsson:dg-ldap_free

Conversation

@danielgustafsson

Copy link
Copy Markdown
Member

unescaped is coming from Curl_urldecode and not a unicode conversion function, so reclaiming its memory should be performed with a normal call to free rather than curlx_unicodefree. In reality, this is the same thing as curlx_unicodefree is implemented as a call to free but that's not guaranteed to always hold (and is less readable in this case IMO).

@jay jay left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

curlx_unicodefree uses (free) with parentheses so it is not overridden by the memory debugger free macro. in other words the curlx functions are not meant to be memory tracked, afaict

unescaped is coming from Curl_urldecode and not a unicode conversion
function, so reclaiming its memory should be performed with a normal
call to free rather than curlx_unicodefree.  In reality, this is the
same thing as curlx_unicodefree is implemented as a call to free but
that's not guaranteed to always hold.  Using the curlx macro present
issues with memory debugging as well.

Closes curl#6671
Reviewed-by: Jay Satiro <raysatiro@yahoo.com>
@danielgustafsson

Copy link
Copy Markdown
Member Author

Found two more instances so pushed a small rebase with those for another just-in-case run through the CI farm before landing this is in master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants