From: Anthony Liguori <aliguori@us.ibm.com>
To: qemu-devel@nongnu.org
Cc: Kevin Wolf <kwolf@suse.de>
Subject: Re: [Qemu-devel] [PATCH] Fix qemu_realloc()
Date: Wed, 11 Feb 2009 15:02:19 -0600 [thread overview]
Message-ID: <49933CDB.8090308@us.ibm.com> (raw)
In-Reply-To: <1234270635-7365-1-git-send-email-kwolf@suse.de>
Kevin Wolf wrote:
> For qemu_realloc with size == 0 a result of NULL is perfectly fine
>
> Signed-off-by: Kevin Wolf <kwolf@suse.de>
>
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)
>
prev parent reply other threads:[~2009-02-11 21:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-10 12:57 [Qemu-devel] [PATCH] Fix qemu_realloc() Kevin Wolf
2009-02-11 21:02 ` Anthony Liguori [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49933CDB.8090308@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=kwolf@suse.de \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.