qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] Fix qemu_realloc()


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH] Fix qemu_realloc()
Date: Wed, 11 Feb 2009 15:02:19 -0600
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Kevin Wolf wrote:
For qemu_realloc with size == 0 a result of NULL is perfectly fine

Signed-off-by: Kevin Wolf <address@hidden>

Applied.  Thanks.

Regards,

Anthony Liguori

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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]