mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-02-08 20:05:29 +08:00
Merge pull request #454 from grissiom/fix-memheap
memheap: check the USED bit in rt_memheap_free
This commit is contained in:
@@ -517,6 +517,7 @@ void rt_memheap_free(void *ptr)
|
||||
|
||||
/* check magic */
|
||||
RT_ASSERT((header_ptr->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
|
||||
RT_ASSERT(header_ptr->magic & RT_MEMHEAP_USED);
|
||||
/* check whether this block of memory has been over-written. */
|
||||
RT_ASSERT((header_ptr->next->magic & RT_MEMHEAP_MASK) == RT_MEMHEAP_MAGIC);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user