From: Alex Brainman Date: Wed, 10 Nov 2010 23:38:45 +0000 (+1100) Subject: runtime: free memory allocated by windows CommandLineToArgv X-Git-Tag: weekly.2010-11-23~37 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b6111370989afd7d35176c609b957e4a61f15cf5;p=gostls13.git runtime: free memory allocated by windows CommandLineToArgv R=golang-dev, r2 CC=golang-dev https://golang.org/cl/3003043 --- 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); }