summaryrefslogtreecommitdiff
path: root/lib/libcrypto/bio/b_sock.c
diff options
context:
space:
mode:
authorAlexander Bluhm <bluhm@cvs.openbsd.org>2018-02-06 14:45:53 +0000
committerAlexander Bluhm <bluhm@cvs.openbsd.org>2018-02-06 14:45:53 +0000
commit1476771263c9728b50711de9aa390173a38faa14 (patch)
tree8c1d5e94b72156fc7c791bb293b1a8ad182fae5e /lib/libcrypto/bio/b_sock.c
parent8908b974b7b4d3fe78c967e47585c035f31d2314 (diff)
Do not call freeaddrinfo() with a NULL parameter.
OK jsing@
Diffstat (limited to 'lib/libcrypto/bio/b_sock.c')
-rw-r--r--lib/libcrypto/bio/b_sock.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/libcrypto/bio/b_sock.c b/lib/libcrypto/bio/b_sock.c
index 48f39838b34..cfa48c68602 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.67 2017/04/30 17:54:11 beck Exp $ */
+/* $OpenBSD: b_sock.c,v 1.68 2018/02/06 14:45:52 bluhm Exp $ */
/*
* Copyright (c) 2017 Bob Beck <beck@openbsd.org>
*
@@ -184,7 +184,8 @@ BIO_get_accept_socket(char *host, int bind_mode)
err:
free(str);
- freeaddrinfo(res);
+ if (res != NULL)
+ freeaddrinfo(res);
if ((ret == 0) && (s != -1)) {
close(s);
s = -1;