[PATCH] util: Fix missing initializer for agent

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

 



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@xxxxxxxxxx>
---

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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]