vercel-labs / vercel-labs/native
cef.zig: InstallResult.archive_path leaks on success
Nobody has claimed this yet.
- Dominant language
- Zig
- Stars
- 7.7k
- Forks
- 314
- Avg merge
- 5h
- Merged PRs (30d)
- 13
Description
installPrepared and installOfficial in src/tooling/cef.zig allocate archive_path via std.fs.path.join(allocator, ...) (lines 338 and 397). The errdefer allocator.free(archive_path) only covers error returns on success the slice is handed to the caller as InstallResult.archive_path.
The only caller, run() at line 284, never reads or frees that field, so the allocation leaks on every successful install.
Verified with std.testing.allocator:
[DebugAllocator] (err): memory address 0x105560400 leaked:
std.fs.path.join ... src/tooling/cef.zig:341 in installPrepared
src/tooling/cef.zig:322 in install
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in src/tooling/cef.zig by reading installPrepared and installOfficial, then follow their result into run() at line 284. Reproduce the success path with std.testing.allocator and verify that a successful install no longer reports an archive_path allocation leak.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- zig
- Domain
- desktop-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 76/100