提交 0b36b0e9 编写于 作者: J John Ferlan

util: Cleanup error path for virPolkitAgentCreate

More fallout from changing to using virPolkitAgent and handling error
paths.  Needed to clear the 'cmd' once stored and of course add the
virCommandFree(cmd) in the error: label.
上级 f5f1ccbc
......@@ -182,6 +182,7 @@ virPolkitAgentCreate(void)
if (VIR_ALLOC(agent) < 0)
goto error;
agent->cmd = cmd;
cmd = NULL;
virCommandAddArgFormat(cmd, "%lld", (long long int) getpid());
virCommandAddArg(cmd, "--notify-fd");
......@@ -206,6 +207,7 @@ virPolkitAgentCreate(void)
VIR_FORCE_CLOSE(pipe_fd[0]);
VIR_FORCE_CLOSE(pipe_fd[1]);
virPolkitAgentDestroy(agent);
virCommandFree(cmd);
return NULL;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册