提交 13b10e05 编写于 作者: M Markus Armbruster 提交者: Stefan Hajnoczi

qapi: Fix unchecked strdup() by converting to g_strdup()

Note that we already free with g_free().
Signed-off-by: NMarkus Armbruster <armbru@redhat.com>
Reviewed-by: NEric Blake <eblake@redhat.com>
Reviewed-by: NLuiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: NStefan Hajnoczi <stefanha@redhat.com>
上级 be168af8
......@@ -92,7 +92,7 @@ char **qmp_get_command_list(void)
list_head = list = g_malloc0(count * sizeof(char *));
QTAILQ_FOREACH(cmd, &qmp_commands, node) {
*list = strdup(cmd->name);
*list = g_strdup(cmd->name);
list++;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册