diff mbox

[1/4] qemu-option: Replace pointless use of g_malloc0() by g_malloc()

Message ID 1422456844-13043-2-git-send-email-armbru@redhat.com
State New
Headers show

Commit Message

Markus Armbruster Jan. 28, 2015, 2:54 p.m. UTC
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(-)

Comments

Gonglei (Arei) Jan. 29, 2015, 12:20 a.m. UTC | #1
On 2015/1/28 22:54, Markus Armbruster wrote:

> 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(-)

Reviewed-by: Gonglei <arei.gonglei@huawei.com>
diff mbox

Patch

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;