[PR #836] Utf8ToWideCharParser: Fix memory leak in case of error #24338

Open
opened 2026-01-31 09:02:40 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/microsoft/terminal/pull/836

State: closed
Merged: Yes


Summary of the Pull Request

std::unique_ptr.release() releases ownership and does not destroy an object.
Fix this issue by using reset(nullptr)

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

_Reset() is used only in the two places:

  • in case of _currentState == _State::Error
  • when some exception has occured during parsing or converting
**Original Pull Request:** https://github.com/microsoft/terminal/pull/836 **State:** closed **Merged:** Yes --- ## Summary of the Pull Request std::unique_ptr.release() releases ownership and does not destroy an object. Fix this issue by using reset(nullptr) ## PR Checklist * [ ] Closes #xxx * [x] CLA signed. If not, go over [here](https://cla.opensource.microsoft.com/microsoft/Terminal) and sign the CLA * [ ] Tests added/passed * [ ] Requires documentation to be updated * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments _Reset() is used only in the two places: - in case of `_currentState == _State::Error` - when some exception has occured during parsing or converting
claunia added the pull-request label 2026-01-31 09:02:40 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#24338