[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [PATCH 1/4] qemu-option: Replace pointless use of g_mallo
From: |
Markus Armbruster |
Subject: |
[Qemu-trivial] [PATCH 1/4] qemu-option: Replace pointless use of g_malloc0() by g_malloc() |
Date: |
Wed, 28 Jan 2015 15:54:01 +0100 |
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>
---
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
- [Qemu-trivial] [PATCH 0/4] Pair g_malloc() with g_free(), not free(), Markus Armbruster, 2015/01/28
- [Qemu-trivial] [PATCH 2/4] qemu-option: Pair g_malloc() with g_free(), not free(), Markus Armbruster, 2015/01/28
- [Qemu-trivial] [PATCH 3/4] spapr_vio: Pair g_malloc() with g_free(), not free(), Markus Armbruster, 2015/01/28
- [Qemu-trivial] [PATCH 1/4] qemu-option: Replace pointless use of g_malloc0() by g_malloc(),
Markus Armbruster <=
- [Qemu-trivial] [PATCH 4/4] usb: Pair g_malloc() with g_free(), not free(), Markus Armbruster, 2015/01/28
- Re: [Qemu-trivial] [Qemu-devel] [PATCH 0/4] Pair g_malloc() with g_free(), not free(), Eric Blake, 2015/01/28