aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Brainman <alex.brainman@gmail.com>2010-11-11 10:38:45 +1100
committerAlex Brainman <alex.brainman@gmail.com>2010-11-11 10:38:45 +1100
commitb6111370989afd7d35176c609b957e4a61f15cf5 (patch)
treea2b3c3a815e9243954bf710e99ea9a4471051696
parente8605b12794500ed3f108b47463942af9d008470 (diff)
downloadgo-b6111370989afd7d35176c609b957e4a61f15cf5.tar.gz
go-b6111370989afd7d35176c609b957e4a61f15cf5.zip
runtime: free memory allocated by windows CommandLineToArgv
R=golang-dev, r2 CC=golang-dev https://golang.org/cl/3003043
-rw-r--r--src/pkg/runtime/windows/thread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pkg/runtime/windows/thread.c b/src/pkg/runtime/windows/thread.c
index a094b28da4..6d961beea1 100644
--- a/src/pkg/runtime/windows/thread.c
+++ b/src/pkg/runtime/windows/thread.c
@@ -85,7 +85,7 @@ runtime·windows_goargs(void)
extern Slice os·Args;
extern Slice os·Envs;
- void *gcl, *clta, *ges, *fes;
+ void *gcl, *clta, *ges, *fes, *lf;
uint16 *cmd, *env, **argv;
String *gargv;
String *genvv;
@@ -95,6 +95,7 @@ runtime·windows_goargs(void)
gcl = runtime·get_proc_addr("kernel32.dll", "GetCommandLineW");
clta = runtime·get_proc_addr("shell32.dll", "CommandLineToArgvW");
ges = runtime·get_proc_addr("kernel32.dll", "GetEnvironmentStringsW");
+ lf = runtime·get_proc_addr("kernel32.dll", "LocalFree");
fes = runtime·get_proc_addr("kernel32.dll", "FreeEnvironmentStringsW");
cmd = runtime·stdcall(gcl, 0);
@@ -123,6 +124,7 @@ runtime·windows_goargs(void)
os·Envs.len = envc;
os·Envs.cap = envc;
+ runtime·stdcall(lf, 1, argv);
runtime·stdcall(fes, 1, env);
}