未验证 提交 b082876c 编写于 作者: G greed-island 提交者: GitHub

Update mem.c

rt_realloc may cause <lfree> change, if we don't change <lfree> timely, it may cause memory leakage
上级 7f6755c6
......@@ -489,6 +489,12 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
{
((struct heap_mem *)&heap_ptr[mem2->next])->prev = ptr2;
}
if (mem2 < lfree)
{
/* the splited struct is now the lowest */
lfree = mem2;
}
plug_holes(mem2);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册