Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak in Utf8_16.cpp #14099

Closed
trcrsired opened this issue Sep 5, 2023 · 0 comments
Closed

Memory leak in Utf8_16.cpp #14099

trcrsired opened this issue Sep 5, 2023 · 0 comments
Assignees
Labels

Comments

@trcrsired
Copy link

if (!m_pFile->write(buf, bufIndex*sizeof(utf16))) return 0;

If the condition !m_pFile->write(buf, bufIndex * sizeof(utf16)) evaluates to true, the delete[] operation will never be executed, potentially leading to a memory leak. Additionally, throwing exceptions might also trigger memory leak scenarios.

@donho donho self-assigned this Sep 6, 2023
@donho donho added the accepted label Sep 6, 2023
donho added a commit to donho/notepad-plus-plus that referenced this issue Sep 6, 2023
@donho donho closed this as completed in 02cc028 Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants