From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Gc1-00044u-65 for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:06:42 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W9Gbw-00006F-Aj for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:06:37 -0500 Received: from mx1.redhat.com ([209.132.183.28]:36407) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W9Gbw-00005v-45 for qemu-devel@nongnu.org; Fri, 31 Jan 2014 11:06:32 -0500 Message-ID: <52EBC9FE.5060200@redhat.com> Date: Fri, 31 Jan 2014 09:06:22 -0700 From: Eric Blake MIME-Version: 1.0 References: <1391183604-21621-1-git-send-email-armbru@redhat.com> <1391183604-21621-2-git-send-email-armbru@redhat.com> In-Reply-To: <1391183604-21621-2-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="U9Ojgbx8u6mEwcs2b07dUuIpEblp66PGx" Subject: Re: [Qemu-devel] [PATCH 1/2] qga: Fix memory allocation pasto List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Markus Armbruster , qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, mdroth@linux.vnet.ibm.com, aliguori@amazon.com, agraf@suse.de This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --U9Ojgbx8u6mEwcs2b07dUuIpEblp66PGx Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 01/31/2014 08:53 AM, Markus Armbruster wrote: > qmp_guest_file_seek() allocates memory for a GuestFileRead object > instead of the GuestFileSeek object it actually uses. Harmless, > because the GuestFileRead is slightly larger. >=20 > Signed-off-by: Markus Armbruster > --- > qga/commands-posix.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Reviewed-by: Eric Blake >=20 > diff --git a/qga/commands-posix.c b/qga/commands-posix.c > index 8100bee..8763308 100644 > --- a/qga/commands-posix.c > +++ b/qga/commands-posix.c > @@ -525,7 +525,7 @@ struct GuestFileSeek *qmp_guest_file_seek(int64_t h= andle, int64_t offset, > if (ret =3D=3D -1) { > error_setg_errno(err, errno, "failed to seek file"); > } else { > - seek_data =3D g_malloc0(sizeof(GuestFileRead)); > + seek_data =3D g_new0(GuestFileSeek, 1); > seek_data->position =3D ftell(fh); > seek_data->eof =3D feof(fh); > } >=20 --=20 Eric Blake eblake redhat com +1-919-301-3266 Libvirt virtualization library http://libvirt.org --U9Ojgbx8u6mEwcs2b07dUuIpEblp66PGx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Public key at http://people.redhat.com/eblake/eblake.gpg Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBCAAGBQJS68n+AAoJEKeha0olJ0NqujoH/jmkU9nPRjMQnlXr4KK65Yp4 pR8PFQCSlvrnXED+RIuG59z2JG8bhZgdDJgFSf8ioqA8dTOKtsm7sMcPwm2FJSC3 uofVuTZhbMjbf1rhwCGbPB35eJHJaiRAKI6hvBRzxteXktHquLSGeBRjGJYtxnrT l+4CDGCMGh4Jvetiw+RmDQCdsEOez65xLjHPiXCKxpcu0VPmMbsZwHQZjlr/up/z TG80Lu3dv7SGrEr1F6PrP0s/doThqo5/QConXHNSBlln18fHzWi9BvQEI1xQjQyK gK1zurWkaaxxw1SGSFZr7JaiTtMjNGpuIvDOuBRFlXoKaHBI+HtSNO5/R+HX0mk= =Y9+Q -----END PGP SIGNATURE----- --U9Ojgbx8u6mEwcs2b07dUuIpEblp66PGx--