From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34875) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbW74-0001ZN-9l for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:56:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbW71-00087d-3t for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:56:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43980) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbW70-00087X-UY for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:56:11 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 92D09A2C04 for ; Mon, 14 Sep 2015 15:56:10 +0000 (UTC) References: <1442231643-23630-1-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55F6EE19.30703@redhat.com> Date: Mon, 14 Sep 2015 09:56:09 -0600 MIME-Version: 1.0 In-Reply-To: <1442231643-23630-1-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Aj1HR4Db62gwJWuAQAOtxwsLeQuIHcUta" Subject: Re: [Qemu-devel] [PATCH] qemu-char: Use g_new() & friends where that makes obvious sense List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: pbonzini@redhat.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Aj1HR4Db62gwJWuAQAOtxwsLeQuIHcUta Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2015 05:54 AM, Markus Armbruster wrote: > g_new(T, n) is neater than g_malloc(sizeof(T) * n). It's also safer, > for two reasons. One, it catches multiplication overflowing size_t. > Two, it returns T * rather than void *, which lets the compiler catch > more type errors. >=20 > This commit only touches allocations with size arguments of the form > sizeof(T). Same Coccinelle semantic patchas in commit b45c03f. >=20 > Signed-off-by: Markus Armbruster > --- > backends/testdev.c | 4 ++-- > qemu-char.c | 22 +++++++++++----------- > 2 files changed, 13 insertions(+), 13 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Aj1HR4Db62gwJWuAQAOtxwsLeQuIHcUta Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJV9u4ZAAoJEKeha0olJ0NqcT8IAJSxVkCAPVLyIyebgITQGpQ1 PoGMM2lNHEbNaRAxr6YntxIYPrR7CIUnfU+VyTw2T/HHoueDVIk3DV+7bv1LOZYE R6Sid2IGSPaW2EevOyPP+lyvv1dJr8IokgyPuZ0r8F5zYDcsDOImz3HqnXYVaUMb tcu6mQ+HJA64xqWv9JFqM6S6RlHrCvQuDMExU+rrMuo1hCAxzMFMiob66jXY5cgZ /TUzIfZElwKcdSruvGCjQTko705KAl95Vw/Me7rAkheGcpqk17mlLsPFyXvoluYr vpG/aqze3eNwm81afaDWv95AK+Axjy6ugSnzB8smpp91I1o/nfszuR0+L191kN8= =OOZI -----END PGP SIGNATURE----- --Aj1HR4Db62gwJWuAQAOtxwsLeQuIHcUta--