qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: Stefan Weil <sw@weilnetz.de>
Cc: Laszlo Ersek <lersek@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] qapi: Fix memory leak
Date: Sun, 19 Aug 2012 01:06:07 +0400	[thread overview]
Message-ID: <503003BF.6040603@msgid.tls.msk.ru> (raw)
In-Reply-To: <1345323089-26232-1-git-send-email-sw@weilnetz.de>

On 19.08.2012 00:51, Stefan Weil wrote:

> +++ b/qapi/opts-visitor.c
> @@ -416,7 +416,7 @@ opts_visitor_cleanup(OptsVisitor *ov)

>          g_hash_table_destroy(ov->unprocessed_opts);
>      }
>      g_free(ov->fake_id_opt);
> -    memset(ov, '\0', sizeof *ov);
> +    g_free(ov);

Shouldn't the function be named opts_visitor_free() or .._destroy()
in this case?  Or should maybe the caller free "ov" instead of
this function?  To me it looks like either both free+rename shoud
be made, or none.

Thanks,

/mjt

  parent reply	other threads:[~2012-08-18 21:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-18 20:51 [Qemu-devel] [PATCH] qapi: Fix memory leak Stefan Weil
2012-08-18 21:01 ` Stefan Weil
2012-08-19 10:37   ` Peter Maydell
2012-08-18 21:06 ` Michael Tokarev [this message]
2012-08-19 10:15   ` Laszlo Ersek
2012-08-19 10:12 ` Laszlo Ersek
2012-08-20 14:05   ` Luiz Capitulino

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=503003BF.6040603@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=lersek@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=sw@weilnetz.de \
    /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).