diff options
| author | Bernard Xiong <[email protected]> | 2015-05-05 10:21:10 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-05-05 10:21:10 +0800 |
| commit | c1d2e97c78fd5729dc83dbc40ae850eb5cf2c9e7 (patch) | |
| tree | bdf6f9eacf1df274d2850ef3ad35f0c296a8897f | |
| parent | 1bd91f8b05ce5fada2e247d659f324e8ee1ac732 (diff) | |
[Kernel] Add magic checking in rt_memheap_free routine.
| -rw-r--r-- | src/memheap.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/memheap.c b/src/memheap.c index adb5c86053..86e4461675 100644 --- a/src/memheap.c +++ b/src/memheap.c @@ -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); |
