# Dir.makeOpenPathAccessMaskW: Fix leaking intermediate directory handles · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/5490021ab7d97425a44b78e218b5462f960d9c9d)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 5490021ab7d97425a44b78e218b5462f960d9c9d

Requested commit: 5490021ab7d97425a44b78e218b5462f960d9c9d

Commit: 5490021ab7d97425a44b78e218b5462f960d9c9d

Tree: bdbf16fdd0658573db8f1871b8a86f0b6445c166

Author: Ryan Liptak

Committer: Ryan Liptak

## Message

```
Dir.makeOpenPathAccessMaskW: Fix leaking intermediate directory handles

Fixes a regression introduced in 67455c5e70e86dbb7805ff9a415f1b13b14f36da. The `errdefer` cannot run since its not possible for an error to occur, and we don't want it to run on the last handle, so we move the closing back down to where it was before 67455c5e70e86dbb7805ff9a415f1b13b14f36da.

```

## Parents

- [332fbb4b027a5529e58b1e46d785718a7faa75e6](https://git.cafe/gitcafe/zig/commit/332fbb4b027a5529e58b1e46d785718a7faa75e6?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/5490021ab7d97425a44b78e218b5462f960d9c9d?format=markdown)
