Skip to content

Commit

Permalink
locale0.cpp: Protect memory integrity of _Fac_node (#4916)
Browse files Browse the repository at this point in the history
Co-authored-by: Casey Carter <cacarter@microsoft.com>
  • Loading branch information
li-boxuan and CaseyCarter committed Aug 28, 2024
1 parent 4811be8 commit 3cf597e
Showing 1 changed file with 0 additions and 2 deletions.
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

0 comments on commit 3cf597e

Please sign in to comment.