mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
rpc: Use g_autofree in virNetClientNewLibSSH2()
Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
ab6de9f04b
commit
2619aaaa3a
@ -442,13 +442,13 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host,
|
||||
virNetClientPtr ret = NULL;
|
||||
|
||||
virBuffer buf = VIR_BUFFER_INITIALIZER;
|
||||
char *nc = NULL;
|
||||
char *command = NULL;
|
||||
g_autofree char *nc = NULL;
|
||||
g_autofree char *command = NULL;
|
||||
|
||||
char *homedir = NULL;
|
||||
char *confdir = NULL;
|
||||
char *knownhosts = NULL;
|
||||
char *privkey = NULL;
|
||||
g_autofree char *homedir = NULL;
|
||||
g_autofree char *confdir = NULL;
|
||||
g_autofree char *knownhosts = NULL;
|
||||
g_autofree char *privkey = NULL;
|
||||
|
||||
/* Use default paths for known hosts an public keys if not provided */
|
||||
if (knownHostsPath) {
|
||||
@ -517,12 +517,6 @@ virNetClientPtr virNetClientNewLibSSH2(const char *host,
|
||||
goto cleanup;
|
||||
|
||||
cleanup:
|
||||
VIR_FREE(command);
|
||||
VIR_FREE(privkey);
|
||||
VIR_FREE(knownhosts);
|
||||
VIR_FREE(homedir);
|
||||
VIR_FREE(confdir);
|
||||
VIR_FREE(nc);
|
||||
return ret;
|
||||
|
||||
no_memory:
|
||||
|
Loading…
x
Reference in New Issue
Block a user