Fixed a memory corruption issue in rt_realloc().

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@495 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
kyle.hu.gz 2010-03-16 19:51:36 +00:00
parent 237b400982
commit 9ac8c55353
1 changed files with 1 additions and 1 deletions

View File

@ -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);