qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Amit Shah <amit.shah@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qemu-io: Fix memory leak
Date: Fri, 20 Nov 2009 09:35:06 +0100	[thread overview]
Message-ID: <4B0654BA.10608@redhat.com> (raw)
In-Reply-To: <20091120080547.GB4112@amit-x200.redhat.com>

Am 20.11.2009 09:05, schrieb Amit Shah:
> 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.

In the context of this function it would be inconsistent, and I'd be
surprised if the rest of the qemu code was consistent with your
expectations. After all, it's a matter of taste, and in such questions I
tend to stick with the style of the surrounding code.

Kevin

  reply	other threads:[~2009-11-20  8:36 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
2009-11-20  8:35   ` Kevin Wolf [this message]
  -- 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=4B0654BA.10608@redhat.com \
    --to=kwolf@redhat.com \
    --cc=amit.shah@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).