summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src/apps
diff options
context:
space:
mode:
authorlogan <logan@openbsd.org>2014-05-25 20:51:21 +0000
committerlogan <logan@openbsd.org>2014-05-25 20:51:21 +0000
commita50ba70eaab6fcc7f89cbdf477e941b54d3f005b (patch)
tree34c82d1811857b4ea58f9a265447f790e5927b53 /lib/libssl/src/apps
parent-noout mentions a CRL, which is incorrect. Use "no output of encoded session (diff)
downloadwireguard-openbsd-a50ba70eaab6fcc7f89cbdf477e941b54d3f005b.tar.xz
wireguard-openbsd-a50ba70eaab6fcc7f89cbdf477e941b54d3f005b.zip
Fix resource descriptor leaks.
CID: 966576 & 966577 OK from guenther@ and "Yup. looks good." from tedu@
Diffstat (limited to 'lib/libssl/src/apps')
-rw-r--r--lib/libssl/src/apps/s_socket.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/libssl/src/apps/s_socket.c b/lib/libssl/src/apps/s_socket.c
index ca685684cfa..d825fd73a52 100644
--- a/lib/libssl/src/apps/s_socket.c
+++ b/lib/libssl/src/apps/s_socket.c
@@ -122,6 +122,7 @@ init_client(int *sock, char *host, char *port, int type, int af)
(char *) &i, sizeof(i));
if (i < 0) {
perror("keepalive");
+ close(s);
return (0);
}
}
@@ -281,16 +282,19 @@ redoit:
} else {
if ((*host = strdup(h1->h_name)) == NULL) {
perror("strdup");
+ close(ret);
return (0);
}
h2 = gethostbyname(*host);
if (h2 == NULL) {
BIO_printf(bio_err, "gethostbyname failure\n");
+ close(ret);
return (0);
}
if (h2->h_addrtype != AF_INET) {
BIO_printf(bio_err, "gethostbyname addr is not AF_INET\n");
+ close(ret);
return (0);
}
}