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

Note that we already free with g_free().

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
Markus Armbruster 2013-01-22 11:08:05 +01:00 committed by Stefan Hajnoczi
parent be168af860
commit 13b10e05e4
1 changed files with 1 additions and 1 deletions

View File

@ -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++;
}