[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH] 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.

Signed-off-by: John Ferlan <jferlan redhat com>
---

Pushing as trivial

 src/util/virpolkit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virpolkit.c b/src/util/virpolkit.c
index 3d2be61..44f2328 100644
--- a/src/util/virpolkit.c
+++ b/src/util/virpolkit.c
@@ -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;
-- 
2.5.0


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]