From 322691a5c9f1c8531554148d47c078b5be590805 Mon Sep 17 00:00:00 2001 From: aliguori Date: Wed, 11 Feb 2009 21:00:32 +0000 Subject: [PATCH] Fix qemu_realloc() (Kevin Wolf) For qemu_realloc with size == 0 a result of NULL is perfectly fine Signed-off-by: Kevin Wolf Signed-off-by: Anthony Liguori git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6615 c046a42c-6fe2-441c-8c8c-71466251a162 --- qemu-malloc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/qemu-malloc.c b/qemu-malloc.c index e9e49cb8f2..676185786c 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)