]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
idn: fix memory leak in `win32_ascii_to_idn()`
authorViktor Szakats <commit@vsz.me>
Mon, 1 Dec 2025 14:52:10 +0000 (15:52 +0100)
committerViktor Szakats <commit@vsz.me>
Mon, 1 Dec 2025 15:39:07 +0000 (16:39 +0100)
Closes #19789

lib/idn.c

index 1c404f6543f3bd97484aadecceed69b05d714934..38f2845f260ec60c77ad353e352c1b86ac3168f5 100644 (file)
--- a/lib/idn.c
+++ b/lib/idn.c
@@ -201,6 +201,7 @@ static CURLcode win32_ascii_to_idn(const char *in, char **output)
     WCHAR idn[IDN_MAX_LENGTH]; /* stores a UTF-16 string */
     int chars = IdnToUnicode(0, in_w, (int)(wcslen(in_w) + 1), idn,
                              IDN_MAX_LENGTH);
+    curlx_unicodefree(in_w);
     if(chars) {
       /* 'chars' is "the number of characters retrieved" */
       char *mstr = curlx_convert_wchar_to_UTF8(idn);