summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGrissiom <[email protected]>2015-01-16 11:41:20 +0800
committerGrissiom <[email protected]>2015-01-16 11:41:20 +0800
commitf8c171d5ad752045a243e846718585ec1c671771 (patch)
tree26e0cbfce7074102db3927d408ab6b3c3c579ac8 /src
parent571095e84c87edc9c0412a52696e124cb3c0d9ff (diff)
memheap: check against over written in rt_memheap_free
Diffstat (limited to 'src')
-rw-r--r--src/memheap.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/memheap.c b/src/memheap.c
index e19c83a08c..adb5c86053 100644
--- a/src/memheap.c
+++ b/src/memheap.c
@@ -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;