[PATCH 13/19] phyp_driver: Resolve Coverity RESOURCE_LEAK

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

 



Coverity determines that when jumping to the connected: label, the
addressinfo (ai) is not free'd.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/phyp/phyp_driver.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c
index aa1e105..ea1981a 100644
--- a/src/phyp/phyp_driver.c
+++ b/src/phyp/phyp_driver.c
@@ -946,6 +946,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
         sock = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol);
         if (sock >= 0) {
             if (connect(sock, cur->ai_addr, cur->ai_addrlen) == 0) {
+                freeaddrinfo(ai);
                 goto connected;
             }
             VIR_FORCE_CLOSE(sock);
-- 
1.9.3

--
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]