From 79564bee5039b251d4301514e362f37ad2837708 Mon Sep 17 00:00:00 2001 From: inoguchi Date: Thu, 24 Mar 2022 14:07:08 +0000 Subject: [PATCH] Check function return value --- usr.bin/openssl/ts.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/openssl/ts.c b/usr.bin/openssl/ts.c index dfd5c3a464f..a05e9677bc5 100644 --- a/usr.bin/openssl/ts.c +++ b/usr.bin/openssl/ts.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ts.c,v 1.21 2022/03/24 13:47:55 inoguchi Exp $ */ +/* $OpenBSD: ts.c,v 1.22 2022/03/24 14:07:08 inoguchi Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -1172,7 +1172,8 @@ create_cert_store(char *ca_path, char *ca_file) int i; /* Creating the X509_STORE object. */ - cert_ctx = X509_STORE_new(); + if ((cert_ctx = X509_STORE_new()) == NULL) + goto err; /* Setting the callback for certificate chain verification. */ X509_STORE_set_verify_cb(cert_ctx, verify_cb); -- 2.20.1