mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-08 22:15:21 +00:00
rpc: Don't check the output of virGetUserConfigDirectory()
virGetUserConfigDirectory() *never* *ever* returns NULL, making the checks for it completely unnecessary. Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
2db0583c73
commit
964482aec2
@ -455,11 +455,9 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host,
|
||||
knownhosts = g_strdup(knownHostsPath);
|
||||
} else {
|
||||
confdir = virGetUserConfigDirectory();
|
||||
if (confdir) {
|
||||
virBufferAsprintf(&buf, "%s/known_hosts", confdir);
|
||||
if (!(knownhosts = virBufferContentAndReset(&buf)))
|
||||
goto no_memory;
|
||||
}
|
||||
virBufferAsprintf(&buf, "%s/known_hosts", confdir);
|
||||
if (!(knownhosts = virBufferContentAndReset(&buf)))
|
||||
goto no_memory;
|
||||
}
|
||||
|
||||
if (privkeyPath) {
|
||||
@ -556,8 +554,7 @@ virNetClientPtr virNetClientNewLibssh(const char *host,
|
||||
knownhosts = g_strdup(knownHostsPath);
|
||||
} else {
|
||||
confdir = virGetUserConfigDirectory();
|
||||
if (confdir)
|
||||
knownhosts = g_strdup_printf("%s/known_hosts", confdir);
|
||||
knownhosts = g_strdup_printf("%s/known_hosts", confdir);
|
||||
}
|
||||
|
||||
if (privkeyPath) {
|
||||
|
Loading…
Reference in New Issue
Block a user