util: Fix missing initializer for agent

In virPolkitAgentCreate neglected to initialize agent to NULL. If
there was an error in the pipe, then we jump to error and would have
an issue. Found by coverity.
This commit is contained in:
John Ferlan 2016-03-01 19:36:37 -05:00
parent b3a4b176f0
commit 95aa101795

View File

@ -166,7 +166,7 @@ virPolkitAgentDestroy(virPolkitAgentPtr agent)
virPolkitAgentPtr
virPolkitAgentCreate(void)
{
virPolkitAgentPtr agent;
virPolkitAgentPtr agent = NULL;
virCommandPtr cmd = virCommandNewArgList(PKTTYAGENT, "--process", NULL);
int pipe_fd[2] = {-1, -1};
struct pollfd pollfd;