phyp_driver: Resolve Coverity RESOURCE_LEAK
Coverity determines that when jumping to the connected: label, the addressinfo (ai) is not free'd.
This commit is contained in:
parent
ad4966d91a
commit
bc9929958d
@ -946,6 +946,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth,
|
|||||||
sock = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol);
|
sock = socket(cur->ai_family, cur->ai_socktype, cur->ai_protocol);
|
||||||
if (sock >= 0) {
|
if (sock >= 0) {
|
||||||
if (connect(sock, cur->ai_addr, cur->ai_addrlen) == 0) {
|
if (connect(sock, cur->ai_addr, cur->ai_addrlen) == 0) {
|
||||||
|
freeaddrinfo(ai);
|
||||||
goto connected;
|
goto connected;
|
||||||
}
|
}
|
||||||
VIR_FORCE_CLOSE(sock);
|
VIR_FORCE_CLOSE(sock);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user