diff options
author | Araq <rumpf_a@web.de> | 2015-11-26 21:20:10 +0100 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2015-11-26 21:20:10 +0100 |
commit | 22ed2aab35005df30d946e04d2ca2581d1cc9f36 (patch) | |
tree | 22be7a9f067ea3d7e376b886eea9374e8f10986c | |
parent | 85345d2d348d7bb0d83da7f69448c8a5be91af18 (diff) | |
download | Nim-22ed2aab35005df30d946e04d2ca2581d1cc9f36.tar.gz |
fixes memory leak for getAppFilename on Windows
-rw-r--r-- | lib/pure/os.nim | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/pure/os.nim b/lib/pure/os.nim index 7c14c46cf..1e00f92b1 100644 --- a/lib/pure/os.nim +++ b/lib/pure/os.nim @@ -1361,7 +1361,7 @@ proc getAppFilename*(): string {.rtl, extern: "nos$1", tags: [ReadIOEffect].} = # /proc/<pid>/file when defined(windows): when useWinUnicode: - var buf = cast[WideCString](alloc(256*2)) + var buf = newWideCString("", 256) var len = getModuleFileNameW(0, buf, 256) result = buf$len else: |