[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PULL 22/46] qemu-option: Replace pointless use of g_mall
From: |
Michael Tokarev |
Subject: |
[Qemu-trivial] [PULL 22/46] qemu-option: Replace pointless use of g_malloc0() by g_malloc() |
Date: |
Tue, 10 Feb 2015 09:34:11 +0300 |
From: Markus Armbruster <address@hidden>
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 <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
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;
--
2.1.4
- [Qemu-trivial] [PULL 40/46] migration: Fix warnings caused by missing 'static' attribute, (continued)
- [Qemu-trivial] [PULL 40/46] migration: Fix warnings caused by missing 'static' attribute, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 46/46] virtio: Fix warning caused by missing 'static' attribute, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 05/46] Add/convert trace calls in pcnet-pci.c., Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 23/46] qemu-option: Pair g_malloc() with g_free(), not free(), Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 20/46] linux-user: wrong TARGET_SI_PAD_SIZE value for some targets., Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 33/46] kvm: g_malloc() can't fail, bury dead error handling, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 15/46] cpu-exec: simplify icount code, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 35/46] vnc: g_realloc() can't fail, bury dead error handling, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 16/46] qemu-sockets: improve error reporting in unix_listen_opts, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 44/46] stubs: Fix warning caused by missing include statement, Michael Tokarev, 2015/02/10
- [Qemu-trivial] [PULL 22/46] qemu-option: Replace pointless use of g_malloc0() by g_malloc(),
Michael Tokarev <=