mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-02 15:23:53 -06:00
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>
This commit is contained in:
parent
23b42894b3
commit
4bca81ceed
3 changed files with 14 additions and 18 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue