提交 96c044af 编写于 作者: M Markus Armbruster 提交者: Michael Tokarev

qemu-option: Replace pointless use of g_malloc0() by g_malloc()

get_opt_value() takes a write-only buffer, so zeroing it is pointless.
We don't do it elsewhere, either.
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NGonglei <arei.gonglei@huawei.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Signed-off-by: NMichael Tokarev <mjt@tls.msk.ru>
上级 b41112c4
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册