Fix leak of command line arguments on Windows

See https://learn.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-commandlinetoargvw#remarks
This commit is contained in:
Robert Müller 2023-10-05 22:37:12 +02:00
parent 2b115b92fa
commit a42ca9f638

View file

@ -4039,6 +4039,7 @@ void cmdline_fix(int *argc, const char ***argv)
new_argv[i + 1] = new_argv[i] + size; new_argv[i + 1] = new_argv[i] + size;
} }
LocalFree(wide_argv);
new_argv[wide_argc] = 0; new_argv[wide_argc] = 0;
*argc = wide_argc; *argc = wide_argc;
*argv = (const char **)new_argv; *argv = (const char **)new_argv;