microsoft / microsoft/terminal
Missing operator delete/delete[] for some allocated objects
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 105k
- Forks
- 9.6k
- Avg merge
- 3d 17h
- Merged PRs (30d)
- 29
Description
Hi.
Looks like there are few places in the Terminal code where I can suspect a memory leaks due to missing operator delete or operator delete[].
These allocation sites can be grouped into following:
- raw
operator newwithoutoperator deletelike this https://github.com/Microsoft/Terminal/blob/master/src/cascadia/TerminalConnection/ConptyConnection.cpp#L191 - allocation by
operator newsome global object or class member (https://github.com/Microsoft/Terminal/blob/master/src/cascadia/TerminalControl/TermControl.cpp#L281) - allocation by
operator newsome memory in a function and return it by raw pointer, which can leak then.
Here is my gist with quite a simple grep foroperator new calls - https://gist.github.com/dreamer-dead/c43248466fc4d445378b4dfba80d8d25
Is this an intentional behaviour or a bug that should be fixed?
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
Review the allocation sites identified in ConptyConnection.cpp around line 191 and TermControl.cpp around line 281, then compare them with the linked grep results. Determine whether each raw allocation has an appropriate owner and matching deletion, and whether the behavior is intentional. Done means documenting the conclusion or addressing confirmed leaks across the listed sites.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100