From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36177) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WHkEq-0002bA-Sq for qemu-devel@nongnu.org; Sun, 23 Feb 2014 20:21:50 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WHkEk-0005q5-K3 for qemu-devel@nongnu.org; Sun, 23 Feb 2014 20:21:44 -0500 Sender: fluxion From: Michael Roth Date: Sun, 23 Feb 2014 19:21:12 -0600 Message-Id: <1393204873-13367-6-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1393204873-13367-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1393204873-13367-1-git-send-email-mdroth@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 5/6] qga: Fix memory allocation pasto List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: aliguori@amazon.com, mprivozn@redhat.com, qemu-stable@nongnu.org, armbru@redhat.com, tomoki.sekiyama@hds.com, mmishael@redhat.com From: Markus Armbruster 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. Signed-off-by: Markus Armbruster Reviewed-by: Eric Blake Cc: qemu-stable@nongnu.org Signed-off-by: Michael Roth --- qga/commands-posix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qga/commands-posix.c b/qga/commands-posix.c index 9188560..6b5f11f 100644 --- a/qga/commands-posix.c +++ b/qga/commands-posix.c @@ -534,7 +534,7 @@ struct GuestFileSeek *qmp_guest_file_seek(int64_t handle, int64_t offset, if (ret == -1) { error_setg_errno(err, errno, "failed to seek file"); } else { - seek_data = g_malloc0(sizeof(GuestFileRead)); + seek_data = g_new0(GuestFileSeek, 1); seek_data->position = ftell(fh); seek_data->eof = feof(fh); } -- 1.7.9.5