From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:46528) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eA6r4-0003vC-6i for qemu-devel@nongnu.org; Thu, 02 Nov 2017 00:11:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eA6r1-0001DO-15 for qemu-devel@nongnu.org; Thu, 02 Nov 2017 00:11:46 -0400 Sender: =?UTF-8?Q?Philippe_Mathieu=2DDaud=C3=A9?= References: <20171006235023.11952-1-f4bug@amsat.org> <20171006235023.11952-89-f4bug@amsat.org> <87po9wstr2.fsf@dusky.pond.sub.org> From: =?UTF-8?Q?Philippe_Mathieu-Daud=c3=a9?= Message-ID: Date: Thu, 2 Nov 2017 01:11:36 -0300 MIME-Version: 1.0 In-Reply-To: <87po9wstr2.fsf@dusky.pond.sub.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Subject: Re: [Qemu-devel] [PATCH 88/88] scripts/coverity-model: use g_new() family of functions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster Cc: =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , Eric Blake , Kevin Wolf , =?UTF-8?Q?Marc-Andr=c3=a9_Lureau?= , qemu trival , qemu-devel@nongnu.org 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é writes: > >> Signed-off-by: Philippe Mathieu-Daudé >> --- >> 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 . 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.