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

locale0.cpp: Protect memory integrity of _Fac_node #4916

Merged
merged 3 commits into from
Aug 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions stl/src/locale0.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ struct _Fac_node { // node for lazy facet recording
delete _Facptr->_Decref();
}

#ifdef _DEBUG
void* operator new(size_t _Size) { // replace operator new
void* _Ptr = _malloc_dbg(_Size > 0 ? _Size : 1, _CRT_BLOCK, __FILE__, __LINE__);
if (!_Ptr) {
Expand All @@ -43,7 +42,6 @@ struct _Fac_node { // node for lazy facet recording
void operator delete(void* _Ptr) noexcept { // replace operator delete
_free_dbg(_Ptr, _CRT_BLOCK);
}
#endif // defined(_DEBUG)

_Fac_node* _Next;
_Facet_base* _Facptr;
Expand Down