mirror of
https://github.com/apache/nuttx.git
synced 2026-05-23 23:28:29 +08:00
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:
committed by
Alan Carvalho de Assis
parent
24af23e49c
commit
b5f8498142
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user