]> Cypherpunks repositories - gostls13.git/commit
os: close fd if fd.Stat fails in Getwd
authorTobias Klauser <tklauser@distanz.ch>
Tue, 22 Sep 2020 12:48:02 +0000 (14:48 +0200)
committerTobias Klauser <tobias.klauser@gmail.com>
Tue, 22 Sep 2020 13:25:27 +0000 (13:25 +0000)
commit0d83fe68a843df2113d0adaac9ac6299a1c2cdad
treebd74b3db0a02feca85720123b7fc0dc92d8bd7a2
parent754776850a62fa37ff6d68a8d5250497b2869b26
os: close fd if fd.Stat fails in Getwd

Avoid leaking fd in case fd.Stat() fails in the fall back implementation
of Getwd.

Change-Id: I8656d42e8dbc8893b7159873f173d6bf0d4febe6
Reviewed-on: https://go-review.googlesource.com/c/go/+/256221
Trust: Tobias Klauser <tobias.klauser@gmail.com>
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
src/os/getwd.go