qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: peter.maydell@linaro.org, mdroth@linux.vnet.ibm.com,
	aliguori@amazon.com, agraf@suse.de
Subject: [Qemu-devel] [PATCH 1/2] qga: Fix memory allocation pasto
Date: Fri, 31 Jan 2014 16:53:23 +0100	[thread overview]
Message-ID: <1391183604-21621-2-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1391183604-21621-1-git-send-email-armbru@redhat.com>

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 <armbru@redhat.com>
---
 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 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 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.8.1.4

  reply	other threads:[~2014-01-31 15:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-31 15:53 [Qemu-devel] [PATCH 0/2] Use g_new() & friends where that makes obvious sense Markus Armbruster
2014-01-31 15:53 ` Markus Armbruster [this message]
2014-01-31 16:06   ` [Qemu-devel] [PATCH 1/2] qga: Fix memory allocation pasto Eric Blake
2014-01-31 15:53 ` [Qemu-devel] [PATCH 2/2] Use g_new() & friends where that makes obvious sense Markus Armbruster
2014-01-31 17:10   ` Eric Blake
2014-01-31 19:13     ` Richard Henderson
2014-02-03  8:56     ` Markus Armbruster
2014-01-31 16:13 ` [Qemu-devel] [PATCH 0/2] " Peter Maydell
2014-02-03  8:40   ` Markus Armbruster
2014-02-03  9:11     ` Peter Maydell
2014-02-04 16:52       ` Markus Armbruster
2014-02-04 17:27         ` Paolo Bonzini
2014-02-13 16:36       ` Markus Armbruster
2014-02-13 16:48         ` Peter Maydell
2014-02-13 19:30           ` Markus Armbruster
2014-02-18 15:32             ` Markus Armbruster
2014-02-21 11:10               ` Peter Maydell
2014-02-21 11:49                 ` Markus Armbruster
2014-02-21 11:52                   ` Peter Maydell
2014-02-21 12:37                     ` Markus Armbruster

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1391183604-21621-2-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=agraf@suse.de \
    --cc=aliguori@amazon.com \
    --cc=mdroth@linux.vnet.ibm.com \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).