summaryrefslogtreecommitdiffstats
path: root/otherlibs/win32unix/createprocess.c
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs/win32unix/createprocess.c')
-rw-r--r--otherlibs/win32unix/createprocess.c2
1 files changed, 2 insertions, 0 deletions
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 */