提交 9ac8c553 编写于 作者: K kyle.hu.gz

Fixed a memory corruption issue in rt_realloc().

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@495 bbd45198-f89e-11dd-88c7-29a3b14d5316
上级 237b4009
......@@ -396,7 +396,7 @@ void *rt_realloc(void *rmem, rt_size_t newsize)
/* expand memory */
nmem = rt_malloc(newsize);
rt_memcpy(nmem, rmem, size);
rt_memcpy(nmem, rmem, size < newsize ? size : newsize);
rt_free(rmem);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册