Merge pull request #413 from grissiom/fix-memheap
memheap: check against over written in rt_memheap_free
This commit is contained in:
commit
2475568190
|
@ -517,6 +517,8 @@ void rt_memheap_free(void *ptr)
|
|||
|
||||
/* check magic */
|
||||
RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
|
||||
/* check whether this block of memory has been over-written. */
|
||||
RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
|
||||
|
||||
/* get pool ptr */
|
||||
heap = header_ptr->pool_ptr;
|
||||
|
|
Loading…
Reference in New Issue