Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

🐞 Possible memory leak in CurrentUser struct

Open
#2,133 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
macos, swift

Research direction

Start at CurrentUser.getCurrentUser(), which is called when opening a workspace and creating a terminal. Inspect how the UnsafeMutablePointer is obtained and who owns it before changing deallocation; reproduce the workspace flow and verify the process no longer leaks or crashes.

Written by the indexing model from the issue text.

Description

bug
Description

In CurrentUser.getCurrentUser(), an UnsafeMutablePointer<passwd> is allocated but never explicitly freed. When I added a deallocate() call in a defer block, the process crashed saying the pointer was freed but never allocated. I am uncertain if there is a memory leak here.

To Reproduce
  1. Open a workspace, thus creating a terminal, which calls CurrentUser.getCurrentUser().
Expected Behavior

No memory leak, but, again, I am uncertain if there is actually a leak here.

Version Information

CodeEdit: 0.3.6-dev (37)
macOS: 15.6.1
Xcode: 26.0

Additional Context

No response

Screenshots

No response

Dominant language
Swift
Stars
23k
Forks
1.2k
PR merge metrics
No merged PRs in 30d

Getting set up

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.

More from CodeEditApp/CodeEdit

All issues in CodeEditApp/CodeEdit

Similar issues

More Swift issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.