diff --git a/Changes b/Changes index 7112398ca..7306f4f5a 100644 --- a/Changes +++ b/Changes @@ -13,6 +13,7 @@ Runtime system: Standard library: - PR#6577: improve performance of %L, %l, %n, %S, %C format specifiers (Alain Frisch) +- PR#6585: fix memory leak in win32unix/createprocess.c Type system: - PR#6374: allow "_ t" as a short-hand for "(_, _, ..) t" for n-ary type diff --git a/otherlibs/win32unix/createprocess.c b/otherlibs/win32unix/createprocess.c index 0e1e37a24..3858a39b8 100644 --- a/otherlibs/win32unix/createprocess.c +++ b/otherlibs/win32unix/createprocess.c @@ -53,9 +53,11 @@ value win_create_process_native(value cmd, value cmdline, value env, /* Create the process */ if (! CreateProcess(exefile, String_val(cmdline), NULL, NULL, TRUE, flags, envp, NULL, &si, &pi)) { + caml_stat_free(exefile); win32_maperr(GetLastError()); uerror("create_process", cmd); } + caml_stat_free(exefile); CloseHandle(pi.hThread); /* Return the process handle as pseudo-PID (this is consistent with the wait() emulation in the MSVC C library */