# std: fix memory bug in getExternalExecutor · gitcafe/zig

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

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

Visibility: public

Requested revision: df9462690f9ca28e1b0fc3185f319c335cc3a32c

Requested commit: df9462690f9ca28e1b0fc3185f319c335cc3a32c

Commit: df9462690f9ca28e1b0fc3185f319c335cc3a32c

Tree: eb6e4403fc165083630411ce4ba4dcf8fc182d5e

Author: Jakub Konka

Committer: Jakub Konka

## Message

```
std: fix memory bug in getExternalExecutor

Until now, we would pass `candidate: NativeTargetInfo` which creates
a copy of the `NativeTargetInfo.DynamicLinker` buffer. We would then
return this buffer in `bad_dl: []const u8` which would goes out-of-scope
the moment we leave this function frame yielding garbage. To fix this,
we just need to remember to pass by const-pointer
`candidate: *const NativeTargetInfo`.

```

## Parents

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

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