summaryrefslogtreecommitdiffstats
path: root/apps/s_server.c
diff options
context:
space:
mode:
authorxkernel <xkernel.wang@foxmail.com>2022-03-07 16:06:17 +0800
committerTomas Mraz <tomas@openssl.org>2022-03-14 09:54:36 +0100
commitaef0e2a12a33068906bed1699bcb32fdcdae47ec (patch)
tree36c20c1084e443feb9508d3cebd282802ac87a44 /apps/s_server.c
parente1cb5bf4c61f5ac7ec354da9a3b3762c64e31332 (diff)
check return value of functions that call BIO_new() internally
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/17821)
Diffstat (limited to 'apps/s_server.c')
-rw-r--r--apps/s_server.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/apps/s_server.c b/apps/s_server.c
index c2d121362a..9db9cfec5e 100644
--- a/apps/s_server.c
+++ b/apps/s_server.c
@@ -1805,8 +1805,13 @@ int s_server_main(int argc, char *argv[])
if (bio_s_out == NULL) {
if (s_quiet && !s_debug) {
bio_s_out = BIO_new(BIO_s_null());
- if (s_msg && bio_s_msg == NULL)
+ if (s_msg && bio_s_msg == NULL) {
bio_s_msg = dup_bio_out(FORMAT_TEXT);
+ if (bio_s_msg == NULL) {
+ BIO_printf(bio_err, "Out of memory\n");
+ goto end;
+ }
+ }
} else {
bio_s_out = dup_bio_out(FORMAT_TEXT);
}