diff options
Diffstat (limited to 'qga/commands-posix-ssh.c')
-rw-r--r-- | qga/commands-posix-ssh.c | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/qga/commands-posix-ssh.c b/qga/commands-posix-ssh.c index 749167e82d..2dda136d64 100644 --- a/qga/commands-posix-ssh.c +++ b/qga/commands-posix-ssh.c @@ -293,17 +293,12 @@ qmp_guest_ssh_get_authorized_keys(const char *username, Error **errp) ret = g_new0(GuestAuthorizedKeys, 1); for (i = 0; authkeys[i] != NULL; i++) { - strList *new; - g_strstrip(authkeys[i]); if (!authkeys[i][0] || authkeys[i][0] == '#') { continue; } - new = g_new0(strList, 1); - new->value = g_strdup(authkeys[i]); - new->next = ret->keys; - ret->keys = new; + QAPI_LIST_PREPEND(ret->keys, g_strdup(authkeys[i])); } return g_steal_pointer(&ret); |