qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Kevin Wolf <kwolf@redhat.com>
To: Eric Blake <eblake@redhat.com>
Cc: weidong.huang@huawei.com, qemu-trivial@nongnu.org,
	qemu-devel@nongnu.org, arei.gonglei@huawei.com,
	stefanha@redhat.com, pbonzini@redhat.com
Subject: Re: [Qemu-devel] [PATCH] oslib-posix: change free to g_free
Date: Sun, 12 Oct 2014 09:44:18 +0200	[thread overview]
Message-ID: <20141012074418.GB3739@noname.redhat.com> (raw)
In-Reply-To: <5438A2C8.80508@redhat.com>

Am 11.10.2014 um 05:23 hat Eric Blake geschrieben:
> On 10/10/2014 08:54 PM, arei.gonglei@huawei.com wrote:
> > From: Gonglei <arei.gonglei@huawei.com>
> > 
> > The caller of qemu_vfree() maybe not check whether parameter
> > ptr pointer is NULL or not, such as vpc_open().
> > Using g_free() is more safe.
> 
> NACK.  g_free is only safe for pointers allocated by g_malloc.
> qemu_vfree is for use on pointers allocated by qemu_try_memalign and
> friends (matching the name valloc which is an older spelling of
> posix_memalign), which are NOT allocated by g_malloc.  Furthermore,
> free(NULL) is safe.

I second that. Strong NACK.

Kevin

      reply	other threads:[~2014-10-12  7:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-11  2:54 [Qemu-devel] [PATCH] oslib-posix: change free to g_free arei.gonglei
2014-10-11  3:10 ` zhanghailiang
2014-10-11  3:21   ` Gonglei
2014-10-11  3:26     ` Eric Blake
2014-10-11  3:32       ` Gonglei
2014-10-11  3:44         ` Eric Blake
2014-10-11  3:47           ` Gonglei
2014-10-11  3:23 ` Eric Blake
2014-10-12  7:44   ` Kevin Wolf [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=20141012074418.GB3739@noname.redhat.com \
    --to=kwolf@redhat.com \
    --cc=arei.gonglei@huawei.com \
    --cc=eblake@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=stefanha@redhat.com \
    --cc=weidong.huang@huawei.com \
    /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).