Copy proper amount of memory.

This commit is contained in:
Bartosz Taudul 2020-04-14 02:22:14 +02:00
parent 366153a94f
commit 9fc76990e1

View File

@ -6211,7 +6211,7 @@ void Worker::UpdateSampleStatisticsImpl( const CallstackFrameData** frames, uint
if( it == m_data.revParentFrameMap.end() ) if( it == m_data.revParentFrameMap.end() )
{ {
auto frame = m_slab.Alloc<CallstackFrame>( fxsz-1 ); auto frame = m_slab.Alloc<CallstackFrame>( fxsz-1 );
memcpy( frame, cfdata, fxsz * sizeof( CallstackFrame ) ); memcpy( frame, cfdata, ( fxsz-1 ) * sizeof( CallstackFrame ) );
auto frameData = m_slab.AllocInit<CallstackFrameData>(); auto frameData = m_slab.AllocInit<CallstackFrameData>();
frameData->data = frame; frameData->data = frame;
frameData->size = fxsz - 1; frameData->size = fxsz - 1;