vercel-labs / vercel-labs/native

cef.zig: InstallResult.archive_path leaks on success

Open Beginner friendly
#32 0 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.