From 24f850f4a49ffd1638f4bfb8b594d8f0bc34ced2 Mon Sep 17 00:00:00 2001 From: Daniel Gustafsson Date: Mon, 1 Mar 2021 09:31:33 +0100 Subject: ldap: use correct memory free function 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 #6671 Reviewed-by: Jay Satiro Reviewed-by: Daniel Stenberg --- lib/ldap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ldap.c b/lib/ldap.c index 307ebebaf..7d23cc5b2 100644 --- a/lib/ldap.c +++ b/lib/ldap.c @@ -875,7 +875,7 @@ static int _ldap_url_parse2(struct Curl_easy *data, ludp->lud_dn = curlx_convert_UTF8_to_tchar(unescaped); /* Free the unescaped string as we are done with it */ - curlx_unicodefree(unescaped); + free(unescaped); if(!ludp->lud_dn) { rc = LDAP_NO_MEMORY; @@ -943,7 +943,7 @@ static int _ldap_url_parse2(struct Curl_easy *data, ludp->lud_attrs[i] = curlx_convert_UTF8_to_tchar(unescaped); /* Free the unescaped string as we are done with it */ - curlx_unicodefree(unescaped); + free(unescaped); if(!ludp->lud_attrs[i]) { free(attributes); @@ -1010,7 +1010,7 @@ static int _ldap_url_parse2(struct Curl_easy *data, ludp->lud_filter = curlx_convert_UTF8_to_tchar(unescaped); /* Free the unescaped string as we are done with it */ - curlx_unicodefree(unescaped); + free(unescaped); if(!ludp->lud_filter) { rc = LDAP_NO_MEMORY; -- cgit v1.2.1