aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorqmuntal <quimmuntal@gmail.com>2024-10-14 21:32:40 +0200
committerGopher Robot <gobot@golang.org>2024-10-14 20:58:52 +0000
commit5c1a68aedd09ba9992ca0b1c6d0a00d8e1ce8f8f (patch)
tree36626dc8539ceac54427dac1626c9b19104ee7f1 /src
parent89f29a772a519cbf352513b55356291a94e15ada (diff)
downloadgo-5c1a68aedd09ba9992ca0b1c6d0a00d8e1ce8f8f.tar.xz
internal/syscall/windows: fix handle leak in Mkdirat
Mkdirat does not close the handle returned by CreateFile, but it should. Mkdirat has been introduced in this developer cycle, so it is not necessary to backport this fix to any release branch. Change-Id: Icddac5ccdc6a142a5be5392a39aba2ae7cc9c69a Reviewed-on: https://go-review.googlesource.com/c/go/+/620195 LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Ian Lance Taylor <iant@google.com> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Quim Muntal <quimmuntal@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/internal/syscall/windows/at_windows.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/internal/syscall/windows/at_windows.go b/src/internal/syscall/windows/at_windows.go
index 17a8c592f9..064564c5e0 100644
--- a/src/internal/syscall/windows/at_windows.go
+++ b/src/internal/syscall/windows/at_windows.go
@@ -164,5 +164,6 @@ func Mkdirat(dirfd syscall.Handle, name string, mode uint32) error {
if err != nil {
return ntCreateFileError(err, 0)
}
+ syscall.CloseHandle(h)
return nil
}