Am 11.10.2014 um 05:23 hat Eric Blake geschrieben:
> On 10/10/2014 08:54 PM, arei.gong...@huawei.com wrote:
> > From: Gonglei
> >
> > 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_fre
On 2014/10/11 11:44, Eric Blake wrote:
> On 10/10/2014 09:32 PM, Gonglei wrote:
>
Actually, I had noted that C standard says it is a no-operation.
But that doesn't mean that every C-library handles it like that.
>>>
>>> EVERY libc that is C89 compliant handles it like that. The last
>>
On 10/10/2014 09:32 PM, Gonglei wrote:
>>> Actually, I had noted that C standard says it is a no-operation.
>>> But that doesn't mean that every C-library handles it like that.
>>
>> EVERY libc that is C89 compliant handles it like that. The last
>> platform that failed on free(NULL) was SunOS 4,
On 2014/10/11 11:26, Eric Blake wrote:
> On 10/10/2014 09:21 PM, Gonglei wrote:
>
>>
>> Actually, I had noted that C standard says it is a no-operation.
>> But that doesn't mean that every C-library handles it like that.
>
> EVERY libc that is C89 compliant handles it like that. The last
> plat
On 10/10/2014 09:21 PM, Gonglei wrote:
>
> Actually, I had noted that C standard says it is a no-operation.
> But that doesn't mean that every C-library handles it like that.
EVERY libc that is C89 compliant handles it like that. The last
platform that failed on free(NULL) was SunOS 4, which is
On 10/10/2014 08:54 PM, arei.gong...@huawei.com wrote:
> From: Gonglei
>
> 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 fo
On 2014/10/11 11:10, Zhanghailiang wrote:
> On 2014/10/11 10:54, arei.gong...@huawei.com wrote:
>> From: Gonglei
>>
>> 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.
>>
>
> It seems that free(NULL) i
On 2014/10/11 10:54, arei.gong...@huawei.com wrote:
From: Gonglei
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.
It seems that free(NULL) is harmless.
From section 7.20.3.2/2 of the C99 standard:
The
From: Gonglei
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.
Signed-off-by: Gonglei
---
util/oslib-posix.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/util/oslib-posix.c b/util/os