summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2013-01-22 11:08:06 +0100
committerStefan Hajnoczi <stefanha@redhat.com>2013-01-30 11:14:46 +0100
commit24a53049537886cf93273c01e3d7727444321afc (patch)
tree26cbc43611a3dd1199d6d5216505be8c5efae57d
parent13b10e05e4b89418a78500da05b25164f786d7e4 (diff)
downloadfocaccia-qemu-24a53049537886cf93273c01e3d7727444321afc.tar.gz
focaccia-qemu-24a53049537886cf93273c01e3d7727444321afc.zip
qemu-ga: Fix unchecked strdup() by converting to g_strdup()
I figure it's freed somewhere deep down in QAPI, 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>
-rw-r--r--qga/commands.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/qga/commands.c b/qga/commands.c
index 7ffb35e4af..528b082fa8 100644
--- a/qga/commands.c
+++ b/qga/commands.c
@@ -61,7 +61,7 @@ struct GuestAgentInfo *qmp_guest_info(Error **err)
 
     while (*cmd_list) {
         cmd_info = g_malloc0(sizeof(GuestAgentCommandInfo));
-        cmd_info->name = strdup(*cmd_list);
+        cmd_info->name = g_strdup(*cmd_list);
         cmd_info->enabled = qmp_command_is_enabled(cmd_info->name);
 
         cmd_info_list = g_malloc0(sizeof(GuestAgentCommandInfoList));