summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2021-03-01 09:31:33 +0100
committerDaniel Gustafsson <daniel@yesql.se>2021-03-01 09:31:33 +0100
commit24f850f4a49ffd1638f4bfb8b594d8f0bc34ced2 (patch)
tree0eadd65a24732b11a24053d3e7d5a5fe8d59f22b
parent313faa1bcbd2bcc957e660d98360a82c15fe7c07 (diff)
downloadcurl-24f850f4a49ffd1638f4bfb8b594d8f0bc34ced2.tar.gz
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>
-rw-r--r--lib/ldap.c6
1 files 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;