mm: check double free before adding to delaylist
If free memory is delayed, check case of double free in the first place. Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
This commit is contained in:
parent
24af23e49c
commit
b5f8498142
1 changed files with 7 additions and 0 deletions
|
@ -48,6 +48,13 @@ static void add_delaylist(FAR struct mm_heap_s *heap, FAR void *mem)
|
|||
|
||||
flags = up_irq_save();
|
||||
|
||||
# ifdef CONFIG_DEBUG_ASSERTIONS
|
||||
FAR struct mm_freenode_s *node;
|
||||
|
||||
node = (FAR struct mm_freenode_s *)((FAR char *)mem - MM_SIZEOF_ALLOCNODE);
|
||||
DEBUGASSERT(MM_NODE_IS_ALLOC(node));
|
||||
# endif
|
||||
|
||||
tmp->flink = heap->mm_delaylist[this_cpu()];
|
||||
heap->mm_delaylist[this_cpu()] = tmp;
|
||||
|
||||
|
|
Loading…
Reference in a new issue