sanitizing_allocator: fix zeroing memory when sizeof(T)>1
std::allocator<>::deallocate() second parameter is number of elements, not array size! Signed-off-by: Simon Rozman <simon@rozman.si>
This commit is contained in:
parent
b39aecb224
commit
16df7b86a1
@ -1951,11 +1951,11 @@ namespace winstd
|
|||||||
///
|
///
|
||||||
/// Deallocate object at _Ptr sanitizing its content first
|
/// Deallocate object at _Ptr sanitizing its content first
|
||||||
///
|
///
|
||||||
void deallocate(_In_ pointer _Ptr, _In_ size_type _Size)
|
void deallocate(_In_ pointer _Ptr, _In_ size_type _Count)
|
||||||
{
|
{
|
||||||
// Sanitize then free.
|
// Sanitize then free.
|
||||||
SecureZeroMemory(_Ptr, _Size);
|
SecureZeroMemory(_Ptr, sizeof(_Ty) * _Count);
|
||||||
_Mybase::deallocate(_Ptr, _Size);
|
_Mybase::deallocate(_Ptr, _Count);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user