qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Markus Armbruster <armbru@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org
Subject: [Qemu-devel] [PATCH 1/4] qemu-option: Replace pointless use of g_malloc0() by g_malloc()
Date: Wed, 28 Jan 2015 15:54:01 +0100	[thread overview]
Message-ID: <1422456844-13043-2-git-send-email-armbru@redhat.com> (raw)
In-Reply-To: <1422456844-13043-1-git-send-email-armbru@redhat.com>

get_opt_value() takes a write-only buffer, so zeroing it is pointless.
We don't do it elsewhere, either.

Signed-off-by: Markus Armbruster <armbru@redhat.com>
---
 util/qemu-option.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/util/qemu-option.c b/util/qemu-option.c
index a708241..c779150 100644
--- a/util/qemu-option.c
+++ b/util/qemu-option.c
@@ -213,7 +213,7 @@ void parse_option_size(const char *name, const char *value,
 bool has_help_option(const char *param)
 {
     size_t buflen = strlen(param) + 1;
-    char *buf = g_malloc0(buflen);
+    char *buf = g_malloc(buflen);
     const char *p = param;
     bool result = false;
 
@@ -237,7 +237,7 @@ out:
 bool is_valid_option_list(const char *param)
 {
     size_t buflen = strlen(param) + 1;
-    char *buf = g_malloc0(buflen);
+    char *buf = g_malloc(buflen);
     const char *p = param;
     bool result = true;
 
-- 
1.9.3

  reply	other threads:[~2015-01-28 14:54 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 14:54 [Qemu-devel] [PATCH 0/4] Pair g_malloc() with g_free(), not free() Markus Armbruster
2015-01-28 14:54 ` Markus Armbruster [this message]
2015-01-29  0:20   ` [Qemu-devel] [PATCH 1/4] qemu-option: Replace pointless use of g_malloc0() by g_malloc() Gonglei
2015-01-28 14:54 ` [Qemu-devel] [PATCH 2/4] qemu-option: Pair g_malloc() with g_free(), not free() Markus Armbruster
2015-01-29  0:20   ` Gonglei
2015-01-28 14:54 ` [Qemu-devel] [PATCH 3/4] spapr_vio: " Markus Armbruster
2015-01-29  0:20   ` Gonglei
2015-01-28 14:54 ` [Qemu-devel] [PATCH 4/4] usb: " Markus Armbruster
2015-01-29  0:22   ` Gonglei
2015-01-28 15:13 ` [Qemu-devel] [PATCH 0/4] " Eric Blake
2015-02-04  9:43 ` Markus Armbruster
2015-02-07 13:30 ` Michael Tokarev

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=1422456844-13043-2-git-send-email-armbru@redhat.com \
    --to=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@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).