summaryrefslogtreecommitdiff
path: root/src/regress/lib/libssl/server/servertest.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/regress/lib/libssl/server/servertest.c')
-rw-r--r--src/regress/lib/libssl/server/servertest.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/regress/lib/libssl/server/servertest.c b/src/regress/lib/libssl/server/servertest.c
index d6f2039af1..a71c5f8c66 100644
--- a/src/regress/lib/libssl/server/servertest.c
+++ b/src/regress/lib/libssl/server/servertest.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: servertest.c,v 1.4 2020/10/11 02:30:04 jsing Exp $ */ 1/* $OpenBSD: servertest.c,v 1.5 2021/01/22 15:56:17 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2015, 2016, 2017 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2015, 2016, 2017 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -159,7 +159,7 @@ server_hello_test(int testno, struct server_hello_test *sht)
159 wbio->references = 2; 159 wbio->references = 2;
160 160
161 SSL_set_bio(ssl, rbio, wbio); 161 SSL_set_bio(ssl, rbio, wbio);
162 162
163 if (SSL_accept(ssl) != 0) { 163 if (SSL_accept(ssl) != 0) {
164 fprintf(stderr, "SSL_accept() returned non-zero\n"); 164 fprintf(stderr, "SSL_accept() returned non-zero\n");
165 ERR_print_errors_fp(stderr); 165 ERR_print_errors_fp(stderr);
@@ -172,8 +172,10 @@ server_hello_test(int testno, struct server_hello_test *sht)
172 SSL_CTX_free(ssl_ctx); 172 SSL_CTX_free(ssl_ctx);
173 SSL_free(ssl); 173 SSL_free(ssl);
174 174
175 rbio->references = 1; 175 if (rbio != NULL)
176 wbio->references = 1; 176 rbio->references = 1;
177 if (wbio != NULL)
178 wbio->references = 1;
177 179
178 BIO_free(rbio); 180 BIO_free(rbio);
179 BIO_free(wbio); 181 BIO_free(wbio);