qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [Qemu-devel] [PATCH] oslib-posix: change free to g_fr


From: Kevin Wolf
Subject: Re: [Qemu-trivial] [Qemu-devel] [PATCH] oslib-posix: change free to g_free
Date: Sun, 12 Oct 2014 09:44:18 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Am 11.10.2014 um 05:23 hat Eric Blake geschrieben:
> On 10/10/2014 08:54 PM, address@hidden wrote:
> > From: Gonglei <address@hidden>
> > 
> > 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 via email to

[Prev in Thread] Current Thread [Next in Thread]