[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-stable] [PATCH 5/6] qga: Fix memory allocation pasto
From: |
Michael Roth |
Subject: |
[Qemu-stable] [PATCH 5/6] qga: Fix memory allocation pasto |
Date: |
Sun, 23 Feb 2014 19:21:12 -0600 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Cc: address@hidden
Signed-off-by: Michael Roth <address@hidden>
---
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
- [Qemu-stable] [PULL 0/6] qemu-ga: various fixes, and serial support for w32, Michael Roth, 2014/02/23
- [Qemu-stable] [PATCH 1/6] qga: vss-win32: Use NULL as an invalid pointer for OpenEvent and CreateEvent, Michael Roth, 2014/02/23
- [Qemu-stable] [PATCH 2/6] qga: vss-win32: Fix interference with snapshot creation by other VSS requesters, Michael Roth, 2014/02/23
- [Qemu-stable] [PATCH 3/6] qga: vss-win32: Fix interference with snapshot deletion by other VSS request, Michael Roth, 2014/02/23
- [Qemu-stable] [PATCH 5/6] qga: Fix memory allocation pasto,
Michael Roth <=
- [Qemu-stable] [PATCH 4/6] qga: Don't require 'time' argument in guest-set-time command, Michael Roth, 2014/02/23
- [Qemu-stable] [PATCH 6/6] qemu-ga: isa-serial support on Windows, Michael Roth, 2014/02/23
- Re: [Qemu-stable] [Qemu-devel] [PULL 0/6] qemu-ga: various fixes, and serial support for w32, Peter Maydell, 2014/02/25