Return NULL when asking for 0 bytes with MM_ALLOC (#2986)
This commit is contained in:
committed by
GitHub
parent
6e1e632baf
commit
c5cc89d691
@@ -50,6 +50,11 @@ bool MemoryManager::init()
|
||||
|
||||
void * MemoryManager::alloc( size_t size )
|
||||
{
|
||||
if( !size )
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
int requiredChunks = size / MM_CHUNK_SIZE + ( size % MM_CHUNK_SIZE > 0 ? 1 : 0 );
|
||||
|
||||
MemoryPool * mp = NULL;
|
||||
|
||||
@@ -151,9 +151,7 @@ SampleBuffer::SampleBuffer( const f_cnt_t _frames ) :
|
||||
|
||||
SampleBuffer::~SampleBuffer()
|
||||
{
|
||||
if( m_origData != NULL )
|
||||
MM_FREE( m_origData );
|
||||
|
||||
MM_FREE( m_origData );
|
||||
MM_FREE( m_data );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user