qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Amit Shah <amit.shah@redhat.com>
To: Kevin Wolf <kwolf@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-io: Fix memory leak
Date: Fri, 20 Nov 2009 13:35:47 +0530	[thread overview]
Message-ID: <20091120080547.GB4112@amit-x200.redhat.com> (raw)
In-Reply-To: <1258537379-25369-1-git-send-email-kwolf@redhat.com>

On (Wed) Nov 18 2009 [10:42:59], Kevin Wolf wrote:
> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
> ---
>  qemu-io.c |   10 ++++++----
>  1 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/qemu-io.c b/qemu-io.c
> index cac72e9..c84b361 100644
> --- a/qemu-io.c
> +++ b/qemu-io.c
> @@ -129,7 +129,8 @@ create_iovec(QEMUIOVector *qiov, char **argv, int nr_iov, int pattern)
>  {
>  	size_t *sizes = calloc(nr_iov, sizeof(size_t));
>  	size_t count = 0;
> -	void *buf, *p;
> +	void *buf = NULL;
> +	void *p;
>  	int i;

I'd prefer the init to happen after the declarations -- brings in
consistent style, puts declarations in one blob and makes
initialisations explicit.


		Amit

  parent reply	other threads:[~2009-11-20  8:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-18  9:42 [Qemu-devel] [PATCH] qemu-io: Fix memory leak Kevin Wolf
2009-11-18 19:04 ` Christoph Hellwig
2009-11-20  8:05 ` Amit Shah [this message]
2009-11-20  8:35   ` Kevin Wolf
  -- strict thread matches above, loose matches on Subject: below --
2009-07-08 12:21 Kevin Wolf
2009-07-08 14:11 ` Christoph Hellwig

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=20091120080547.GB4112@amit-x200.redhat.com \
    --to=amit.shah@redhat.com \
    --cc=kwolf@redhat.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).