summaryrefslogtreecommitdiff
path: root/qga/commands-posix.c
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2015-08-27 01:34:50 +0200
committerMichael Roth <mdroth@linux.vnet.ibm.com>2015-09-01 11:07:10 -0500
commit4bca81ceedb59397f6082777f6ed4b39d456be85 (patch)
tree675ba43edd7da179ff0e3ae15748cc4b2975fb1f /qga/commands-posix.c
parent23b42894b389eccb45ab66da3a3e77d3a8cfc2b6 (diff)
downloadqemu-4bca81ceedb59397f6082777f6ed4b39d456be85.tar.gz
qga: make split_list() return allocated strings
In order to avoid any confusion, let's allocate new strings when splitting. Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Denis V. Lunev <den@openvz.org> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
Diffstat (limited to 'qga/commands-posix.c')
-rw-r--r--qga/commands-posix.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 675f4b4c66..fc4fc727f7 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -2454,7 +2454,7 @@ GList *ga_command_blacklist_init(GList *blacklist)
char **p = (char **)list;
while (*p) {
- blacklist = g_list_append(blacklist, *p++);
+ blacklist = g_list_append(blacklist, g_strdup(*p++));
}
}
#endif
@@ -2468,13 +2468,13 @@ GList *ga_command_blacklist_init(GList *blacklist)
char **p = (char **)list;
while (*p) {
- blacklist = g_list_append(blacklist, *p++);
+ blacklist = g_list_append(blacklist, g_strdup(*p++));
}
}
#endif
#if !defined(CONFIG_FSTRIM)
- blacklist = g_list_append(blacklist, (char *)"guest-fstrim");
+ blacklist = g_list_append(blacklist, g_strdup("guest-fstrim"));
#endif
return blacklist;