microsoft / microsoft/PowerToys
Bug: CommandLineToArgvW memory leak in PowerToys.Update.exe
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 139k
- Forks
- 8.6k
- PR merge metrics
- PR metrics pending
Description
## Description
`PowerToys.Update.cpp` WinMain calls `CommandLineToArgvW` but never calls `LocalFree` on the returned pointer, leaking memory on every update execution.
## Impact
Memory leak on every PowerToys.Update.exe invocation. Low severity since the process is short-lived.
## Fix
Add `LocalFree(args)` before all return paths, or use a RAII wrapper.
Found during multi-agent code review of #46889.
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 PowerToys.Update.cpp at WinMain and trace the CommandLineToArgvW call through every return path. Confirm that the returned args pointer is released with LocalFree before the process exits, then verify the update executable still builds and runs normally.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 84/100