From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34114) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbW32-00085d-JC for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:52:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbW2z-0006OZ-BN for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:52:04 -0400 Received: from mx1.redhat.com ([209.132.183.28]:47668) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbW2z-0006OT-5o for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:52:01 -0400 References: <1442231583-23535-1-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55F6ED1F.2040508@redhat.com> Date: Mon, 14 Sep 2015 09:51:59 -0600 MIME-Version: 1.0 In-Reply-To: <1442231583-23535-1-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="Ax8QSjjOson5fp0Kv6alPToiOnvSMu8Hm" Subject: Re: [Qemu-devel] [PATCH] linux-user: 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: riku.voipio@iki.fi This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --Ax8QSjjOson5fp0Kv6alPToiOnvSMu8Hm Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2015 05:53 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 > --- > linux-user/elfload.c | 2 +- > linux-user/main.c | 2 +- > linux-user/syscall.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --Ax8QSjjOson5fp0Kv6alPToiOnvSMu8Hm 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/ iQEcBAEBCAAGBQJV9u0fAAoJEKeha0olJ0NqEjcIAK6lGohNb8Wm1LQ0XWoSZqwc qh6ssZavjs1EOJw2A3lPfIalUSlRjY0aMOSJ8p45UOqvgG+c+t8BBDrvZFghtyBC BctMU8XNyj9brLTcAR/mpw47/jeEUrcde9WOv+QrNobg+cTSCdjv+PW2InfLFUPs XfY/HBrUEyqdwpBQg5/msbcYZ9rpKs/x0QG3RQMB3Yxstbhes4VDYkcz1qBCIP10 K5kk3AEjuhfAZQE2Gg67sgSIBl+ELT5y/1h2rOVc+APxIIBtWdiXZAtB1geod8RM /XXBKB04MdzgPiO4z8qryiR6hCH0Q6j7/q0TlvGCbYXPLDDoZNcORihJnHRi5K4= =wN1n -----END PGP SIGNATURE----- --Ax8QSjjOson5fp0Kv6alPToiOnvSMu8Hm--