提交 998cd537 编写于 作者: F Fabiano Fidêncio

rpc: Use g_autofree in virNetClientNewLibssh()

Signed-off-by: NFabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 2619aaaa
......@@ -545,13 +545,13 @@ virNetClientPtr virNetClientNewLibssh(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) {
......@@ -609,12 +609,6 @@ virNetClientPtr virNetClientNewLibssh(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:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册