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 <raysatiro@yahoo.com>
Reviewed-by: Daniel Stenberg <daniel@haxx.se>
This commit is contained in:
Daniel Gustafsson 2021-03-01 09:31:33 +01:00
parent 313faa1bcb
commit 24f850f4a4
1 changed files with 3 additions and 3 deletions

View File

@ -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;