diff options
author | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-02-11 21:00:32 +0000 |
---|---|---|
committer | aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162> | 2009-02-11 21:00:32 +0000 |
commit | 322691a5c9f1c8531554148d47c078b5be590805 (patch) | |
tree | dc110bb739fcc7a3f8e38380ed49cc7c09a8d14c /qemu-malloc.c | |
parent | 9c22bc63129720e0c1fe6e910b0425923c123a31 (diff) | |
download | qemu-322691a5c9f1c8531554148d47c078b5be590805.zip qemu-322691a5c9f1c8531554148d47c078b5be590805.tar.gz qemu-322691a5c9f1c8531554148d47c078b5be590805.tar.bz2 |
Fix qemu_realloc() (Kevin Wolf)
For qemu_realloc with size == 0 a result of NULL is perfectly fine
Signed-off-by: Kevin Wolf <kwolf@suse.de>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@6615 c046a42c-6fe2-441c-8c8c-71466251a162
Diffstat (limited to 'qemu-malloc.c')
-rw-r--r-- | 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) |