summaryrefslogtreecommitdiff
path: root/lib/libcrypto/bio/b_sock.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-16 10:43:07 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2014-07-16 10:43:07 +0000
commitb1c537f49d02f982927eedc5bdc8f9be397cb508 (patch)
tree70b9da6ee410460cef781128bcbfebaf8954a69d /lib/libcrypto/bio/b_sock.c
parent46f7aef7b61bdb1f74b3772869fcd98233d3d90a (diff)
do not need a variable to track locking, since all code paths have it
locked throughout.
Diffstat (limited to 'lib/libcrypto/bio/b_sock.c')
-rw-r--r--lib/libcrypto/bio/b_sock.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/libcrypto/bio/b_sock.c b/lib/libcrypto/bio/b_sock.c
index ced0406bc15..c095943e8b9 100644
--- a/lib/libcrypto/bio/b_sock.c
+++ b/lib/libcrypto/bio/b_sock.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: b_sock.c,v 1.55 2014/07/13 16:03:09 beck Exp $ */
+/* $OpenBSD: b_sock.c,v 1.56 2014/07/16 10:43:06 deraadt Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -80,7 +80,6 @@ BIO_get_host_ip(const char *str, unsigned char *ip)
{
int i;
int err = 1;
- int locked = 0;
struct hostent *he;
if (inet_pton(AF_INET, str, ip) == 1)
@@ -88,7 +87,6 @@ BIO_get_host_ip(const char *str, unsigned char *ip)
/* do a gethostbyname */
CRYPTO_w_lock(CRYPTO_LOCK_GETHOSTBYNAME);
- locked = 1;
he = BIO_gethostbyname(str);
if (he == NULL) {
BIOerr(BIO_F_BIO_GET_HOST_IP, BIO_R_BAD_HOSTNAME_LOOKUP);
@@ -106,8 +104,7 @@ BIO_get_host_ip(const char *str, unsigned char *ip)
err = 0;
err:
- if (locked)
- CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME);
+ CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME);
if (err) {
ERR_asprintf_error_data("host=%s", str);
return 0;