Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Close ssl_sock before returning error in connect_https_socket()
Spotted by Coverity.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
David Woodhouse authored and David Woodhouse committed Sep 26, 2012
1 parent 7e952ad commit 838223b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ssl.c
Expand Up @@ -111,17 +111,18 @@ int connect_https_socket(struct openconnect_info *vpninfo)
if (cancellable_connect(vpninfo, ssl_sock, vpninfo->peer_addr, vpninfo->peer_addrlen)) {
reconn_err:
if (vpninfo->proxy) {
vpn_progress(vpninfo, PRG_ERR,
vpn_progress(vpninfo, PRG_ERR,
_("Failed to reconnect to proxy %s\n"),
vpninfo->proxy);
} else {
vpn_progress(vpninfo, PRG_ERR,
vpn_progress(vpninfo, PRG_ERR,
_("Failed to reconnect to host %s\n"),
vpninfo->hostname);
}
if (ssl_sock >= 0)
close(ssl_sock);
return -EINVAL;
}

} else {
struct addrinfo hints, *result, *rp;
char *hostname;
Expand Down

0 comments on commit 838223b

Please sign in to comment.