From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:33940) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbW1c-0007pK-GM for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:50:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZbW1X-0005T6-Rp for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:50:36 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZbW1X-0005Sy-Ek for qemu-devel@nongnu.org; Mon, 14 Sep 2015 11:50:31 -0400 References: <1442231444-23257-1-git-send-email-armbru@redhat.com> From: Eric Blake Message-ID: <55F6ECC6.9080204@redhat.com> Date: Mon, 14 Sep 2015 09:50:30 -0600 MIME-Version: 1.0 In-Reply-To: <1442231444-23257-1-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="jKbNCsWS0LsDJKLlb9o8QNuWFqtJie30g" Subject: Re: [Qemu-devel] [PATCH] qga: 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: mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --jKbNCsWS0LsDJKLlb9o8QNuWFqtJie30g Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 09/14/2015 05:50 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 patch as in commit b45c03f. >=20 > Signed-off-by: Markus Armbruster > --- > qga/channel-posix.c | 2 +- > qga/channel-win32.c | 2 +- > qga/commands-posix.c | 10 +++++----- > qga/commands-win32.c | 10 +++++----- > qga/commands.c | 6 +++--- > qga/guest-agent-command-state.c | 4 ++-- > 6 files changed, 17 insertions(+), 17 deletions(-) Reviewed-by: Eric Blake --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --jKbNCsWS0LsDJKLlb9o8QNuWFqtJie30g 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/ iQEcBAEBCAAGBQJV9uzGAAoJEKeha0olJ0Nqy5sH/ROnMm0bJg5TtI42l5erqR5t +TA1fGPa6mDtA5+UBK6nhk9+xXzu99cU5GzjOdDf/ecvSDJ0KogLLDAnfdz7uE6i 9j/PO7facASvzcSRhdV05tqkUYaf718H5uPyYEwpzjmpzVKYQ9kLI/pcYhrkdGYH tDlNpgwQNx+IEejWXSzUCL686kYn10FXxhvl/9wmh1ehz6sggM9N0ot1gTYTOlOK d/2JO46vRfEJYk+7pNPR81CG/OD6TmNDCB4znEb4npD70EY6q9qYuMCajlmmNRIK /gyARwBou9ZVwhaY9PU5tFlKnJFiyvos5M2LYbSi21wYra2w/xOt1B/C8QK1HM4= =7V85 -----END PGP SIGNATURE----- --jKbNCsWS0LsDJKLlb9o8QNuWFqtJie30g--