[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-trivial] [Qemu-devel] [PATCH 88/88] scripts/coverity-model: us
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [Qemu-trivial] [Qemu-devel] [PATCH 88/88] scripts/coverity-model: use g_new() family of functions |
Date: |
Thu, 2 Nov 2017 01:11:36 -0300 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
Hi Markus,
On 10/09/2017 03:46 AM, Markus Armbruster wrote:
> Please cc me on changes to stuff I maintain, as scripts/get_maintainer
> tells you :)
Oops I might have been a copy/paste error.
> Philippe Mathieu-Daudé <address@hidden> writes:
>
>> Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
>> ---
>> scripts/coverity-model.c | 2 +-
[...]
>> GIOChannel *g_io_channel_unix_new(int fd)
>> {
>> - GIOChannel *c = g_malloc0(sizeof(GIOChannel));
>> + GIOChannel *c = g_new0(GIOChannel, 1);
>> __coverity_escape__(fd);
>> return c;
>> }
>
> Hmm.
>
> The Coverity model carefully explains g_malloc0(). It doesn't explain
> g_new0(). With any luck, Coverity can see through g_new0() --- it's a
> macro in my <gmem.h>. But why complicate matters? The normal reason
> for changing g_malloc0() to g_new0() doesn't apply here. Let's leave
> the model alone.
Yes you are right.
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 88/88] scripts/coverity-model: use g_new() family of functions,
Philippe Mathieu-Daudé <=