Skip to content

Commit

Permalink
qapi: Fix unchecked strdup() by converting to g_strdup()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Markus Armbruster authored and stefanhaRH committed Jan 30, 2013
1 parent be168af commit 13b10e0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion qapi/qmp-registry.c
Expand Up @@ -92,7 +92,7 @@ char **qmp_get_command_list(void)
list_head = list = g_malloc0(count * sizeof(char *)); list_head = list = g_malloc0(count * sizeof(char *));


QTAILQ_FOREACH(cmd, &qmp_commands, node) { QTAILQ_FOREACH(cmd, &qmp_commands, node) {
*list = strdup(cmd->name); *list = g_strdup(cmd->name);
list++; list++;
} }


Expand Down

0 comments on commit 13b10e0

Please sign in to comment.