From: John Ferlan Date: Wed, 27 Aug 2014 19:31:38 +0000 (-0400) Subject: phyp_driver: Resolve Coverity RESOURCE_LEAK X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=bc9929958d914f648b573d067ed99a760368c08c;p=libvirt.git phyp_driver: Resolve Coverity RESOURCE_LEAK Coverity determines that when jumping to the connected: label, the addressinfo (ai) is not free'd. --- diff --git a/src/phyp/phyp_driver.c b/src/phyp/phyp_driver.c index aa1e1053ef..ea1981a382 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);