提交 bc992995 编写于 作者: J John Ferlan

phyp_driver: Resolve Coverity RESOURCE_LEAK

Coverity determines that when jumping to the connected: label, the
addressinfo (ai) is not free'd.
上级 ad4966d9
...@@ -946,6 +946,7 @@ openSSHSession(virConnectPtr conn, virConnectAuthPtr auth, ...@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册