[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Fix qemu_realloc()
From: |
Kevin Wolf |
Subject: |
[Qemu-devel] [PATCH] Fix qemu_realloc() |
Date: |
Tue, 10 Feb 2009 13:57:15 +0100 |
For qemu_realloc with size == 0 a result of NULL is perfectly fine
Signed-off-by: Kevin Wolf <address@hidden>
---
qemu-malloc.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/qemu-malloc.c b/qemu-malloc.c
index e9e49cb..6761857 100644
--- a/qemu-malloc.c
+++ b/qemu-malloc.c
@@ -48,7 +48,10 @@ void *qemu_malloc(size_t size)
void *qemu_realloc(void *ptr, size_t size)
{
- return oom_check(realloc(ptr, size));
+ if (size)
+ return oom_check(realloc(ptr, size));
+ else
+ return realloc(ptr, size);
}
void *qemu_mallocz(size_t size)
--
1.6.0.2
- [Qemu-devel] [PATCH] Fix qemu_realloc(),
Kevin Wolf <=