sanitizing_allocator::deallocate() fixed to calculate proper buffer size for non-byte arrays

This commit is contained in:
Simon Rozman 2016-05-17 11:07:38 +02:00
parent 010919ff24
commit 6899f2a7b0

View File

@ -831,10 +831,10 @@ namespace winstd
/// ///
/// Deallocate object at _Ptr sanitizing its content first /// Deallocate object at _Ptr sanitizing its content first
/// ///
inline void deallocate(_In_ pointer _Ptr, _In_ size_type _Count) inline void deallocate(_In_ pointer _Ptr, _In_ size_type _Size)
{ {
// Sanitize then free. // Sanitize then free.
SecureZeroMemory(_Ptr, sizeof(_Ty)*_Count); SecureZeroMemory(_Ptr, _Size);
::operator delete(_Ptr); ::operator delete(_Ptr);
} }