diff options
| author | Bernard Xiong <[email protected]> | 2015-04-09 14:41:54 +0800 |
|---|---|---|
| committer | Bernard Xiong <[email protected]> | 2015-04-09 14:41:54 +0800 |
| commit | 2ff048f7f0170d618333edc4484cb6b09eaf17fd (patch) | |
| tree | f9b6ef9dfabdbc53dd8ca42ecc41abbe2a952c27 | |
| parent | 1c38f85b9b10b6880cf090c44564782cbe6279a8 (diff) | |
| parent | 2d3b2f1e9466b7759ab2a663a2b56e49e3f9852d (diff) | |
Merge pull request #454 from grissiom/fix-memheap
memheap: check the USED bit in rt_memheap_free
| -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); |
