From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54847) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WGqOi-0000D4-JR for qemu-devel@nongnu.org; Fri, 21 Feb 2014 08:44:17 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WGqOd-0002mm-O9 for qemu-devel@nongnu.org; Fri, 21 Feb 2014 08:44:12 -0500 Message-ID: <53075822.40808@redhat.com> Date: Fri, 21 Feb 2014 06:44:02 -0700 From: Eric Blake MIME-Version: 1.0 References: <1392986209-32162-1-git-send-email-armbru@redhat.com> In-Reply-To: <1392986209-32162-1-git-send-email-armbru@redhat.com> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="XfOe8rJ7kgt4RA8mHMeNF8RVUEoPm6T2d" Subject: Re: [Qemu-devel] [PATCH] 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: qemu-trivial@nongnu.org, mdroth@linux.vnet.ibm.com This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --XfOe8rJ7kgt4RA8mHMeNF8RVUEoPm6T2d Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On 02/21/2014 05:36 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 cae4171..2c496b6 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 --XfOe8rJ7kgt4RA8mHMeNF8RVUEoPm6T2d 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/ iQEcBAEBCAAGBQJTB1giAAoJEKeha0olJ0NqfQsH/1dNQdVa8xkZpGjDmxhb300y 2YlS+cyFrmg41WTz8l0QGOfU0FLJShyFhiHMGroT4VsDv9FStf44yM/GoTPp5jDj 28rc+ZIFxvp1vZSsDPrSnCjQelU/I3cAJ98AqS36P8v7lYGdN0Hpt4XOf1r/dhUf sT+vI6KjKucWq14stPZDE93jqr4J9oPIHA+Y27mSO1/DHDYhiGr9P/Cj4L9FXUtQ vESS/m1K6v8i1sDpvB0ClQdItxdLht9rxvRi1mUus8hIAhNx+2rwmlxb+b/f9C/l VW7iWy5BwrUuFu4KcN5f83bVGRfDOCcE+C6ZJh5uvCfrQEAPLXF04DGAOGKd+gE= =oTcH -----END PGP SIGNATURE----- --XfOe8rJ7kgt4RA8mHMeNF8RVUEoPm6T2d--