[syslinux:firmware] core, efi: Return new pointer in realloc()
syslinux-bot for Chandramouli Narayanan
chandramouli.narayanan at intel.com
Fri Nov 9 09:06:16 PST 2012
Commit-ID: 5b138643e73cd2ffc7edab1aea197c200c46f9d4
Gitweb: http://www.syslinux.org/commit/5b138643e73cd2ffc7edab1aea197c200c46f9d4
Author: Chandramouli Narayanan <chandramouli.narayanan at intel.com>
AuthorDate: Fri, 24 Feb 2012 13:19:56 +0000
Committer: Matt Fleming <matt.fleming at intel.com>
CommitDate: Fri, 24 Feb 2012 13:19:56 +0000
core, efi: Return new pointer in realloc()
Instead of returning the pointer to the newly allocated memory,
relloc() currently returns garbage. Return the correct pointer.
Signed-off-by: Chandramouli Narayanan <chandramouli.narayanan at intel.com>
Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
core/mem/malloc.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/core/mem/malloc.c b/core/mem/malloc.c
index dcb5a94..732ad67 100644
--- a/core/mem/malloc.c
+++ b/core/mem/malloc.c
@@ -117,6 +117,7 @@ void *realloc(void *ptr, size_t size)
newptr = AllocatePool(size);
memcpy(newptr, ptr, size);
FreePool(ptr);
+ return newptr;
#else
if (!ptr)
return malloc(size);
More information about the Syslinux-commits
mailing list